当前位置: 首页>>代码示例>>C++>>正文


C++ BMimeType::SetLongDescription方法代码示例

本文整理汇总了C++中BMimeType::SetLongDescription方法的典型用法代码示例。如果您正苦于以下问题:C++ BMimeType::SetLongDescription方法的具体用法?C++ BMimeType::SetLongDescription怎么用?C++ BMimeType::SetLongDescription使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BMimeType的用法示例。


在下文中一共展示了BMimeType::SetLongDescription方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: sizeof

void
InitFileTypes(void)
{
	BMimeType mime;
	BString string;
	BMessage msg,ext;
	
	BBitmap	large_icon(BRect(0, 0, B_LARGE_ICON - 1, B_LARGE_ICON - 1), B_COLOR_8_BIT);
	memcpy(large_icon.Bits(),kProjectLargeIconBits,1024);
	BBitmap	mini_icon(BRect(0, 0, B_MINI_ICON - 1, B_MINI_ICON - 1), B_COLOR_8_BIT);
	memcpy(mini_icon.Bits(),kProjectSmallIconBits,256);
	
	mime.SetType(PROJECT_MIME_TYPE);
	mime.SetShortDescription(TR("Paladin Project"));
	mime.SetLongDescription(TR("File to build a program with Paladin"));
	mime.SetIcon(&large_icon, B_LARGE_ICON);
	mime.SetIcon(&mini_icon, B_MINI_ICON);
	
	#ifdef __HAIKU__
	mime.SetIcon(kProjectVectorIconBits, sizeof(kProjectVectorIconBits));
	#endif
	
	mime.SetSnifferRule("0.50  [0:32]( -i \"NAME=\" | \"TARGETNAME=\" | "
						"\"PLATFORM=\" | \"GROUP=\" | \"SOURCEFILE=\")");
	mime.SetPreferredApp(APP_SIGNATURE);
	mime.Install();
	
	ext.AddString("extensions","pld");
	mime.SetFileExtensions(&ext);
}
开发者ID:tgkokk,项目名称:Paladin,代码行数:30,代码来源:FileUtils.cpp

示例2: checkMimeTypes

		void checkMimeTypes()
		{
			BMimeType mime;
			mime.SetTo("application/x-vnd.BeServed-fileserver");
			mime.Delete();
			if (!mime.IsInstalled())
			{
				mime.Install();
				mime.SetShortDescription("Network File Server");
				mime.SetLongDescription("A network server running BeServed");
				setMimeIcon(&mime, MYNET_ICON_HOST_LARGE, B_LARGE_ICON);
				setMimeIcon(&mime, MYNET_ICON_HOST_SMALL, B_MINI_ICON);
			}

			mime.SetTo("application/x-vnd.BeServed-inetserver");
			mime.Delete();
			if (!mime.IsInstalled())
			{
				mime.Install();
				mime.SetShortDescription("Public File Server");
				mime.SetLongDescription("A remote network server running BeServed");
				setMimeIcon(&mime, MYNET_ICON_INETHOST_LARGE, B_LARGE_ICON);
				setMimeIcon(&mime, MYNET_ICON_INETHOST_SMALL, B_MINI_ICON);
			}

			mime.SetTo("application/x-vnd.BeServed-fileshare");
			mime.Delete();
			if (!mime.IsInstalled())
			{
				mime.Install();
				mime.SetShortDescription("Shared Volume");
				mime.SetLongDescription("A BeServed network shared volume");
				setMimeIcon(&mime, MYNET_ICON_SHARE_LARGE, B_LARGE_ICON);
				setMimeIcon(&mime, MYNET_ICON_SHARE_SMALL, B_MINI_ICON);
			}
		}
开发者ID:HaikuArchives,项目名称:BeServed,代码行数:36,代码来源:MyNetApp.cpp

示例3: InitFileTypes

// This handles the filetypes being installed with all the extra attributes over the
// regular R5 types
void MrPeeps::InitFileTypes(void)
{
    BEntry entry("/boot/home/config/settings/MrPeeps");
    BFile file;

    // Check for settings directory
    if(!entry.Exists())
        create_directory("/boot/home/config/settings/MrPeeps",0777);

    entry.SetTo("/boot/home/config/settings/MrPeeps/MrPeeps");
    if(!entry.Exists())
    {
        file.SetTo("/boot/home/config/settings/MrPeeps/MrPeeps",B_READ_WRITE|B_CREATE_FILE);
        file.Unset();
    }


    entry.SetTo("/boot/home/config/settings/MrPeeps/filetypes_installed");
    if(!entry.Exists())
    {
        BFile file("/boot/home/config/settings/MrPeeps/filetypes_installed",B_CREATE_FILE);
        BMimeType mime;
        BString string;
        BMessage msg,info;
        uint8 installtype=2;
        int32 index=0;
        BBitmap	large_icon(BRect(0, 0, B_LARGE_ICON-1, B_LARGE_ICON-1), B_COLOR_8_BIT);
        BBitmap	mini_icon(BRect(0, 0, B_MINI_ICON-1, B_MINI_ICON-1), B_COLOR_8_BIT);

        // install person mime type
        mime.SetType(PERSON_FILE_TYPE);
        if(mime.IsInstalled())
        {
            if (mime.GetAttrInfo(&info) == B_OK)
            {
                while (info.FindString("attr:name", index++, &string) == B_OK)
                {
                    if (string.Compare(PERSON_EMAIL5)==0)
                        installtype=1;

                    if (string.Compare(PERSON_BIRTHDAY)==0)
                    {
                        installtype=0;
                        break;
                    }
                }
                if (installtype>0)
                    mime.Delete();
            }
        }
        if(installtype>0)
        {
            mime.Install();
            large_icon.SetBits(kLargePersonIcon, large_icon.BitsLength(), 0, B_COLOR_8_BIT);
            mini_icon.SetBits(kSmallPersonIcon, mini_icon.BitsLength(), 0, B_COLOR_8_BIT);
            mime.SetShortDescription("Person");
            mime.SetLongDescription("Information about a person");
            mime.SetIcon(&large_icon, B_LARGE_ICON);
            mime.SetIcon(&mini_icon, B_MINI_ICON);

            BAlert *alert=new BAlert("Mr. Peeps!", "Would you like to make Mr. Peeps! the "
                                     "default application for People files? If not sure, choose 'No'.","Yes","No");

            if(alert->Go()==0)
                mime.SetPreferredApp(APP_SIGNATURE);
            else
                mime.SetPreferredApp("application/x-vnd.Be-PEPL");

            // General Person data
            msg.AddString("attr:public_name", "First Name");
            msg.AddString("attr:name", PERSON_FIRSTNAME);
            msg.AddInt32("attr:type", B_STRING_TYPE);
            msg.AddBool("attr:viewable", true);
            msg.AddBool("attr:editable", true);
            msg.AddInt32("attr:width", 120);
            msg.AddInt32("attr:alignment", B_ALIGN_LEFT);
            msg.AddBool("attr:extra", false);

            msg.AddString("attr:public_name", "Last Name");
            msg.AddString("attr:name", PERSON_LASTNAME);
            msg.AddInt32("attr:type", B_STRING_TYPE);
            msg.AddBool("attr:viewable", true);
            msg.AddBool("attr:editable", true);
            msg.AddInt32("attr:width", 120);
            msg.AddInt32("attr:alignment", B_ALIGN_LEFT);
            msg.AddBool("attr:extra", false);

            msg.AddString("attr:public_name", "Nickname");
            msg.AddString("attr:name", PERSON_NICKNAME);
            msg.AddInt32("attr:type", B_STRING_TYPE);
            msg.AddBool("attr:viewable", true);
            msg.AddBool("attr:editable", true);
            msg.AddInt32("attr:width", 120);
            msg.AddInt32("attr:alignment", B_ALIGN_LEFT);
            msg.AddBool("attr:extra", false);

            msg.AddString("attr:public_name", "Title");
            msg.AddString("attr:name", PERSON_TITLE);
//.........这里部分代码省略.........
开发者ID:slubman,项目名称:MrPeeps,代码行数:101,代码来源:MrPeeps.cpp


注:本文中的BMimeType::SetLongDescription方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。