Added another GetStyledText() function to force a specific encoding.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19847 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2007-01-17 12:04:02 +00:00
parent 691e54b4ab
commit 849de6ef97
2 changed files with 32 additions and 46 deletions
+14 -41
View File
@@ -1,39 +1,11 @@
/*****************************************************************************/
// File: TranslationUtils.h
// Class: BTranslationUtils
// Reimplemented by: Michael Wilber, Translation Kit Team
// Reimplementation: 2002-04
//
// Description: Utility functions for the Translation Kit
//
//
// Copyright (c) 2002 OpenBeOS Project
//
// Original Version: Copyright 1998, Be Incorporated, All Rights Reserved.
// Copyright 1995-1997, Jon Watte
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
/*****************************************************************************/
#if !defined(_TRANSLATION_UTILS_H)
/*
* Copyright 2002-2007, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _TRANSLATION_UTILS_H
#define _TRANSLATION_UTILS_H
#include <TranslationDefs.h>
#include <SupportDefs.h>
@@ -42,10 +14,9 @@ class BTranslatorRoster;
class BPositionIO;
class BMenu;
// This class is a little different from many other classes.
// You don't create an instance of it; you just call its various
// static member functions for utility-like operations.
class BTranslationUtils {
private:
BTranslationUtils();
~BTranslationUtils();
BTranslationUtils(const BTranslationUtils &);
@@ -66,8 +37,10 @@ class BTranslationUtils {
BTranslatorRoster *roster = NULL);
// text functions
static status_t GetStyledText(BPositionIO *fromStream, BTextView *intoView,
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);
@@ -84,9 +57,9 @@ class BTranslationUtils {
B_TRANSLATION_MENU = 'BTMN'
};
static status_t AddTranslationItems(BMenu *intoMenu, uint32 fromType,
const BMessage *model = NULL, // default B_TRANSLATION_MENU
const char *translatorIdName = NULL, // default "be:translator"
const char *translatorTypeName = NULL, // default "be:type"
const BMessage *model = NULL, // default B_TRANSLATION_MENU
const char *translatorIdName = NULL, // default "be:translator"
const char *translatorTypeName = NULL, // default "be:type"
BTranslatorRoster *roster = NULL);
};