2007-01-17 15:04:02 +03:00
|
|
|
/*
|
2009-08-27 18:20:56 +04:00
|
|
|
* Copyright 2002-2009, Haiku Inc. All Rights Reserved.
|
2007-01-17 15:04:02 +03:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
#ifndef _TRANSLATION_UTILS_H
|
2002-07-09 16:24:59 +04:00
|
|
|
#define _TRANSLATION_UTILS_H
|
|
|
|
|
2007-01-17 15:04:02 +03:00
|
|
|
|
2009-08-27 19:45:42 +04:00
|
|
|
#include <GraphicsDefs.h>
|
2002-07-09 16:24:59 +04:00
|
|
|
#include <SupportDefs.h>
|
2009-08-27 18:20:56 +04:00
|
|
|
#include <TranslationDefs.h>
|
|
|
|
|
2002-07-09 16:24:59 +04:00
|
|
|
|
|
|
|
class BBitmap;
|
2007-10-16 00:13:55 +04:00
|
|
|
class BFile;
|
2002-07-09 16:24:59 +04:00
|
|
|
class BMenu;
|
2007-10-16 00:13:55 +04:00
|
|
|
class BMessage;
|
|
|
|
class BPositionIO;
|
|
|
|
class BTextView;
|
|
|
|
class BTranslatorRoster;
|
|
|
|
struct entry_ref;
|
2002-07-09 16:24:59 +04:00
|
|
|
|
2007-01-17 15:04:02 +03:00
|
|
|
|
2002-07-09 16:24:59 +04:00
|
|
|
class BTranslationUtils {
|
2009-08-27 18:20:56 +04:00
|
|
|
BTranslationUtils();
|
|
|
|
BTranslationUtils(
|
|
|
|
const BTranslationUtils& other);
|
|
|
|
~BTranslationUtils();
|
|
|
|
|
|
|
|
BTranslationUtils& operator=(const BTranslationUtils& other);
|
|
|
|
|
|
|
|
public:
|
|
|
|
enum {
|
|
|
|
B_TRANSLATION_MENU = 'BTMN'
|
|
|
|
};
|
|
|
|
|
|
|
|
static BBitmap* GetBitmap(const char* name,
|
|
|
|
BTranslatorRoster* roster = NULL);
|
|
|
|
static BBitmap* GetBitmap(uint32 type, int32 id,
|
|
|
|
BTranslatorRoster* roster = NULL);
|
|
|
|
static BBitmap* GetBitmap(uint32 type, const char* name,
|
|
|
|
BTranslatorRoster* roster = NULL);
|
|
|
|
static BBitmap* GetBitmapFile(const char* name,
|
|
|
|
BTranslatorRoster* roster = NULL);
|
|
|
|
static BBitmap* GetBitmap(const entry_ref* ref,
|
|
|
|
BTranslatorRoster* roster = NULL);
|
|
|
|
static BBitmap* GetBitmap(BPositionIO* stream,
|
|
|
|
BTranslatorRoster* roster = NULL);
|
|
|
|
|
|
|
|
static void SetBitmapColorSpace(color_space space);
|
|
|
|
static color_space BitmapColorSpace();
|
|
|
|
|
|
|
|
static status_t GetStyledText(BPositionIO* fromStream,
|
|
|
|
BTextView* intoView,
|
|
|
|
BTranslatorRoster* roster = NULL);
|
|
|
|
static status_t GetStyledText(BPositionIO* fromStream,
|
|
|
|
BTextView* intoView, const char* encoding,
|
|
|
|
BTranslatorRoster* roster = NULL);
|
|
|
|
static status_t PutStyledText(BTextView* fromView,
|
|
|
|
BPositionIO* intoStream,
|
|
|
|
BTranslatorRoster* roster = NULL);
|
|
|
|
static status_t WriteStyledEditFile(BTextView* fromView,
|
|
|
|
BFile* intoFile);
|
|
|
|
static status_t WriteStyledEditFile(BTextView* fromView,
|
|
|
|
BFile* intoFile, const char* encoding);
|
|
|
|
|
|
|
|
static BMessage* GetDefaultSettings(translator_id translator,
|
|
|
|
BTranslatorRoster* roster = NULL);
|
|
|
|
static BMessage* GetDefaultSettings(const char* name,
|
|
|
|
int32 version);
|
|
|
|
|
|
|
|
static status_t AddTranslationItems(BMenu* intoMenu,
|
|
|
|
uint32 fromType,
|
|
|
|
const BMessage* model = NULL,
|
|
|
|
const char* idName = NULL,
|
|
|
|
const char* typeName = NULL,
|
|
|
|
BTranslatorRoster* roster = NULL);
|
|
|
|
|
|
|
|
private:
|
|
|
|
static color_space sBitmapSpace;
|
2002-07-09 16:24:59 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2009-08-27 18:20:56 +04:00
|
|
|
#endif // _TRANSLATION_UTILS_H
|