Inheritance diagram for os::RegistrarManager:
Public Member Functions | |
RegistrarManager () | |
Constructor. | |
~RegistrarManager () | |
Destructor. | |
void | AddRef () |
void | Put (bool bAll=false) |
Decrements the reference counter of the instance. | |
void | HandleMessage (Message *pcMessage) |
Handle a message targeted at this handler. | |
void | SetSynchronousMode (bool bSync) |
Sets whether the registrar manager class is in synchronous mode. | |
status_t | RegisterType (String zMimeType, String zIdentifier, bool bOverwrite=false) |
Registers a new filetype. | |
status_t | UnregisterType (String zMimeType) |
Unregisters a filetype. | |
status_t | RegisterTypeIcon (String zMimeType, Path cIcon, bool bOverwrite=false) |
Sets a new icon for a filetype. | |
status_t | RegisterTypeIconFromRes (String zMimeType, String zIconRes, bool bOverwrite=false) |
Sets a new icon for a filetype which will be extracted from the application resources. | |
status_t | RegisterTypeExtension (String zMimeType, String zExtension) |
Registers a new extension for a type. | |
status_t | ClearTypeExtensions (String zMimeType) |
Clears the extension list for a type. | |
status_t | RegisterTypeHandler (String zMimeType, Path cHandler) |
Registers a new handler for a type. | |
status_t | RegisterAsTypeHandler (String zMimeType) |
Registers the current application as a handler for a type. | |
status_t | ClearTypeHandlers (String zMimeType) |
Clears the handler list for a type. | |
int32 | GetTypeCount () |
Returns the number of types that are registered for the calling user. | |
RegistrarFileType | GetType (int32 nIndex) |
Returns a RegistrarFileType object that describes a specific type. | |
status_t | SetDefaultHandler (String zMimeType, Path zHandler) |
Sets the default handler for a type. | |
status_t | GetTypeAndIcon (String zFile, Point cIconSize, String *zTypeName, Image **pcIcon, Message *pcMessage=NULL) |
Returns a description and an image for a file. | |
status_t | Launch (Window *pcParentWindow, String zFile, bool bVerbose=false, String zTitle="Select handler", bool bDefaultHandler=true) |
Launches a file. | |
void | UpdateAppList (bool bForce=false) |
Update the application list. | |
RegistrarAppList | GetAppList () |
Returns the application list. | |
Static Public Member Functions | |
static RegistrarManager * | Get () |
Provides access to the RegistrarManager class. | |
Classes | |
class | Private |
... #include <atheos/image.h> #include <storage/registrar.h> MyApp::MyApp() : os::Application( "application/x-vnd-MyApp" ) { try { os::RegistrarManager* pcManager = os::RegistrarManager::Get(); pcManager->RegisterType( "image/x-jpg", "JPEG image" ); pcManager->RegisterAsTypeHandler( "image/x-jpg" ); // Assumes that you added the filetype icon as a resource pcManager->RegisterTypeIconFromRes( "image/x-jpg", "image_jpg.png" ); pcManager->Put(); } }
RegistrarManager::RegistrarManager | ( | ) |
RegistrarManager::~RegistrarManager | ( | ) |
Never delete a RegistrarManager object! Use the Put() method instead.
void RegistrarManager::AddRef | ( | ) |
RegistrarManager * RegistrarManager::Get | ( | ) | [static] |
void RegistrarManager::Put | ( | bool | bAll = false |
) |
void RegistrarManager::HandleMessage | ( | Message * | pcMessage | ) | [virtual] |
pcMessage
is also available through os::Looper::GetCurrentMessage() and os::Looper::DetachCurrentMessage() until this member returns. This is normally not very usefull for HandleMessage() itself but it can be convinient for other members called from HandleMessage() in case they need data from the message that was not passed on from HandleMessage(). pcMessage | The message that should be handled. This message will be deleted by the looper when HandleMessage() returns unless you detach it with os::Looper::DetachCurrentMessage(), |
Reimplemented from os::Handler.
void RegistrarManager::SetSynchronousMode | ( | bool | bSync | ) |
status_t RegistrarManager::RegisterType | ( | String | zMimeType, | |
String | zIdentifier, | |||
bool | bOverwrite = false | |||
) |
zMimeType | - Mimetype of the new type. | |
zIdentifier | - Name of the type. | |
bOverwrite | - Whether the name should be overwritten if a type with the same mimetype already exists. false is almost always right. |
status_t RegistrarManager::UnregisterType | ( | String | zMimeType | ) |
zMimeType | - Mimetype of the type. |
status_t RegistrarManager::RegisterTypeIcon | ( | String | zMimeType, | |
Path | cIcon, | |||
bool | bOverwrite = false | |||
) |
zMimeType | - Mimetype of the type. | |
zIcon | - Path to the new icon. The icon should be in /system/icons/filetypes/. | |
bOverwrite | - Whether the icon should be overwritten if a type with the same mimetype already exists. false is almost always right. |
status_t RegistrarManager::RegisterTypeIconFromRes | ( | String | zMimeType, | |
String | zIconRes, | |||
bool | bOverwrite = false | |||
) |
zMimeType | - Mimetype of the type. | |
zIconRes | - Resource name of the icon. | |
bOverwrite | - Whether the icon should be overwritten if a type with the same mimetype already exists. false is almost always right. |
zMimeType | - Mimetype of the type. | |
zExtension | - Extension that should be registeread. |
status_t RegistrarManager::ClearTypeExtensions | ( | String | zMimeType | ) |
zMimeType | - Mimetype of the type. |
zMimeType | - Mimetype of the type. | |
cHandler | - Absolute path to the handler. |
status_t RegistrarManager::RegisterAsTypeHandler | ( | String | zMimeType | ) |
zMimeType | - Mimetype of the type. |
status_t RegistrarManager::ClearTypeHandlers | ( | String | zMimeType | ) |
zMimeType | - Mimetype of the type. |
int32 RegistrarManager::GetTypeCount | ( | ) |
RegistrarFileType RegistrarManager::GetType | ( | int32 | nIndex | ) |
nIndex | - Index of the type. |
zMimeType | - Mimetype of the type. | |
zHandler | - Absoulte path to the handler. |
status_t RegistrarManager::GetTypeAndIcon | ( | String | zFile, | |
Point | cIconSize, | |||
String * | zTypeName, | |||
Image ** | pcIcon, | |||
Message * | pcMessage = NULL | |||
) |
zFile | - Path to the file. | |
cIconSize | - Requested size of the icon. | |
zTypeName | - Contains the type description after the call. | |
pcIcon | - Contains the icon after the call. | |
pcMessage | - Contains the full description of the type. In the same format as the returned message by GetType(). |
status_t RegistrarManager::Launch | ( | Window * | pcParentWindow, | |
String | zFile, | |||
bool | bVerbose = false , |
|||
os::String | zTitle = "Select handler" , |
|||
bool | bDefaultHandler = true | |||
) |
pcParentWindow | - Parent window. Can be NULL. The handler selector will be centered in this window. | |
zFile | - Absolute path to the file. | |
bVerbose | - Activates verbose mode. | |
zTitle | - Title of the handler selector. | |
bDefaultHandler | - If set to false, the handler selector will always be shown. |
void RegistrarManager::UpdateAppList | ( | bool | bForce = false |
) |
bForce | - Force the registrar to update the list. |
RegistrarAppList RegistrarManager::GetAppList | ( | ) |