Files
haiku-beta6/src/apps/terminal/PrefHandler.h
T
Siarzhuk Zharski 6d30b376e9 Support for underline and ibeam terminal cursor styles
* Add support for underline and i-beam cursor shapes. No corresponding
  UI configuration in preferences view ATM because preferences are waiting
  for refactoring and we need some eggs for this Easters. ;-)
* Add handling of VT520/xterm specific DECSCUSR control sequences
  allowing applications to modify the style and blinking state of the
  cursor. May be utilized, for example, by console version of vim;
* Implement cursor blinking/hiding on DECSET/DECRST commands.
2013-03-14 07:44:47 +00:00

80 lines
2.0 KiB
C++

/*
* Copyright (c) 2003-2006, Haiku, Inc. All Rights Reserved.
* Copyright (c) 2004 Daniel Furrer <[email protected]>
* Copyright (c) 2003-4 Kian Duffy <[email protected]>
* Copyright (c) 1998,99 Kazuho Okui and Takashi Murai.
*
* Distributed unter the terms of the MIT License.
*/
#ifndef PREF_HANDLER_H
#define PREF_HANDLER_H
#include <SupportDefs.h>
#include <GraphicsDefs.h>
#include <Message.h>
class BFont;
class BPath;
struct pref_defaults {
const char *key;
const char *item;
};
#define PREF_TRUE "true"
#define PREF_FALSE "false"
#define PREF_BLOCK_CURSOR "block"
#define PREF_IBEAM_CURSOR "ibeam"
#define PREF_UNDERLINE_CURSOR "underline"
class BMessage;
class BEntry;
class PrefHandler {
public:
PrefHandler(const PrefHandler* p);
PrefHandler();
~PrefHandler();
static PrefHandler *Default();
static void DeleteDefault();
static void SetDefault(PrefHandler *handler);
status_t OpenText(const char *path);
void SaveDefaultAsText();
void SaveAsText(const char *path, const char *minmtype = NULL,
const char *signature = NULL);
int32 getInt32(const char *key);
float getFloat(const char *key);
const char* getString(const char *key);
bool getBool(const char *key);
rgb_color getRGB(const char *key);
int getCursor(const char *key);
void setInt32(const char *key, int32 data);
void setFloat(const char *key, float data);
void setString(const char *key, const char *data);
void setBool(const char *key, bool data);
void setRGB(const char *key, const rgb_color data);
bool IsEmpty() const;
static status_t GetDefaultPath(BPath& path);
private:
void _ConfirmFont(const char *key, const BFont *fallback);
status_t _LoadFromDefault(const pref_defaults* defaults = NULL);
status_t _LoadFromTextFile(const char * path);
BMessage fContainer;
static PrefHandler *sPrefHandler;
};
#endif // PREF_HANDLER_H