haiku/headers/private/locale/EditableCatalog.h
Oliver Tappe 541ff51a6e Cleanup BCatalogAddOn.
* rename BCatalogAddOn to BCatalogData, since it doesn't represent an
  add-on, but rather the catalog data provided by an add-on
* move BCatalogData out of Catalog.{h,cpp} into its own header and
  implementation file
* drop BCatalogData::MarkForTranslation() methods, they're not needed
* drop BCatalog::GetNoAutoCollectString() methods, they're not being
  used anywhere
* cleanup the B_TRANSLATE_... macros somewhat
* add versions of the B_TRANSLATE_MARK_... macros that are meant to be
  used in void context (when the string isn't being used by the program,
  just meant to be picked up by collectcatkeys).
* adjust several apps to use B_TRANSLATE_MARK_..._VOID where needed
* adjust users of BCatalogAddOn accordingly
2012-04-16 00:04:41 +02:00

64 lines
1.5 KiB
C++

/*
* Copyright 2003-2012, Haiku, Inc.
* Distributed under the terms of the MIT License.
*/
#ifndef _EDITABLE_CATALOG_H_
#define _EDITABLE_CATALOG_H_
#include <Catalog.h>
class BMessage;
struct entry_ref;
namespace BPrivate {
class EditableCatalog : public BCatalog {
public:
EditableCatalog(const char* type,
const char* signature,
const char* language);
virtual ~EditableCatalog();
status_t SetString(const char* string,
const char* translated,
const char* context = NULL,
const char* comment = NULL);
status_t SetString(int32 id, const char* translated);
bool CanWriteData() const;
status_t SetData(const char* name, BMessage* msg);
status_t SetData(uint32 id, BMessage* msg);
status_t ReadFromFile(const char* path = NULL);
status_t ReadFromAttribute(
const entry_ref& appOrAddOnRef);
status_t ReadFromResource(
const entry_ref& appOrAddOnRef);
status_t WriteToFile(const char* path = NULL);
status_t WriteToAttribute(
const entry_ref& appOrAddOnRef);
status_t WriteToResource(
const entry_ref& appOrAddOnRef);
void MakeEmpty();
BCatalogData* CatalogData();
private:
EditableCatalog();
EditableCatalog(const EditableCatalog& other);
const EditableCatalog& operator=(const EditableCatalog& other);
// hide assignment, default-, and
// copy-constructor
};
} // namespace BPrivate
#endif /* _EDITABLE_CATALOG_H_ */