mirror of
https://review.haiku-os.org/haiku
synced 2025-02-02 11:46:25 +01:00
f90e454336
class, and only wraps around that one. * Translating is no longer serialized, you can translate more than one object at a time now. * A BTranslator that is released (ie. deleted) will no longer let its BTranslatorRoster crash. * Removed BTranslatorRoster::Version() - this kind of call definitely makes no sense at all. It's still exported from the sources, though, for backwards compatibility. * Simplified and improved code. * Images are now unloaded only once. * Added new method IsTranslator() that will be used by the DataTranslations preferences application. * Began implementing new methods StartWatching()/StopWatching() that will notify you if new translators are installed or old ones removed (this will also be used by DataTranslations once it's ready). * The private BTranslatorRoster class will now add itself to the existing BApplication, in order to provide automatic updating of the translators if needed (not yet implemented though). * Not heavily tested yet, there might be some regressions. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17247 a95241bf-73f2-0310-859d-f6bbb57e9c96
101 lines
2.9 KiB
C++
101 lines
2.9 KiB
C++
/*
|
|
* Copyright 2002-2006, Haiku, Inc. All Rights Reserved.
|
|
* Distributed under the terms of the MIT License.
|
|
*/
|
|
#ifndef _TRANSLATOR_ROSTER_H
|
|
#define _TRANSLATOR_ROSTER_H
|
|
|
|
|
|
#include <Archivable.h>
|
|
#include <TranslationDefs.h>
|
|
|
|
struct translation_format;
|
|
|
|
class BBitmap;
|
|
class BView;
|
|
class BPositionIO;
|
|
class BQuery;
|
|
class BMessage;
|
|
|
|
|
|
class BTranslatorRoster : public BArchivable {
|
|
public:
|
|
BTranslatorRoster();
|
|
BTranslatorRoster(BMessage* model);
|
|
virtual ~BTranslatorRoster();
|
|
|
|
static BTranslatorRoster *Default();
|
|
|
|
virtual status_t Archive(BMessage* into, bool deep = true) const;
|
|
static BArchivable* Instantiate(BMessage* from);
|
|
|
|
status_t AddTranslators(const char* loadPath = NULL);
|
|
status_t AddTranslator(BTranslator* translator);
|
|
|
|
virtual status_t Identify(BPositionIO* source, BMessage* ioExtension,
|
|
translator_info* _info, uint32 hintType = 0,
|
|
const char* hintMIME = NULL, uint32 wantType = 0);
|
|
|
|
virtual status_t GetTranslators(BPositionIO* source,
|
|
BMessage* ioExtension, translator_info** _info, int32* _numInfo,
|
|
uint32 hintType = 0, const char* hintMIME = NULL,
|
|
uint32 wantType = 0);
|
|
|
|
virtual status_t GetAllTranslators(translator_id** _list,
|
|
int32* _count);
|
|
|
|
virtual status_t GetTranslatorInfo(translator_id translatorID,
|
|
const char** _name, const char** _info, int32* _version);
|
|
|
|
virtual status_t GetInputFormats(translator_id translatorID,
|
|
const translation_format** _formats, int32* _numFormats);
|
|
|
|
virtual status_t GetOutputFormats(translator_id translatorID,
|
|
const translation_format** _formats, int32* _numFormats);
|
|
|
|
virtual status_t Translate(BPositionIO* source,
|
|
const translator_info* info, BMessage* ioExtension,
|
|
BPositionIO* destination, uint32 wantOutType,
|
|
uint32 hintType = 0, const char* hintMIME = NULL);
|
|
|
|
virtual status_t Translate(translator_id translatorID,
|
|
BPositionIO* source, BMessage* ioExtension,
|
|
BPositionIO* destination, uint32 wantOutType);
|
|
|
|
virtual status_t MakeConfigurationView(translator_id translatorID,
|
|
BMessage* ioExtension, BView** _view, BRect* _extent);
|
|
|
|
virtual status_t GetConfigurationMessage(translator_id translatorID,
|
|
BMessage* ioExtension);
|
|
|
|
status_t GetRefFor(translator_id translatorID, entry_ref* ref);
|
|
bool IsTranslator(entry_ref* ref);
|
|
|
|
status_t StartWatching(BMessenger target);
|
|
status_t StopWatching(BMessenger target);
|
|
|
|
private:
|
|
// unimplemented
|
|
BTranslatorRoster(const BTranslatorRoster& other);
|
|
BTranslatorRoster& operator=(const BTranslatorRoster& other);
|
|
|
|
virtual void ReservedTranslatorRoster1();
|
|
virtual void ReservedTranslatorRoster2();
|
|
virtual void ReservedTranslatorRoster3();
|
|
virtual void ReservedTranslatorRoster4();
|
|
virtual void ReservedTranslatorRoster5();
|
|
virtual void ReservedTranslatorRoster6();
|
|
|
|
void _Initialize();
|
|
|
|
private:
|
|
class Private;
|
|
|
|
Private* fPrivate;
|
|
int32 fUnused[6];
|
|
|
|
static BTranslatorRoster* sDefaultRoster;
|
|
};
|
|
|
|
#endif /* _TRANSLATOR_ROSTER_H */
|