~siretart/keepassx/debian

« back to all changes in this revision

Viewing changes to src/lib/tools.h

  • Committer: Reinhard Tartler
  • Date: 2009-04-04 09:16:12 UTC
  • mfrom: (4.1.3 upstream)
  • Revision ID: siretart@tauware.de-20090404091612-0e9uiu3u5xz3da6q
merge new upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
#ifndef TOOLS_H
20
20
#define TOOLS_H
21
21
 
22
 
#define CSTR(x)(x.toLocal8Bit().constData())
23
22
class IEntryHandle;
24
 
typedef enum tKeyType {PASSWORD=0,KEYFILE=1,BOTH=2};
 
23
 
 
24
enum tKeyType {PASSWORD=0,KEYFILE=1,BOTH=2};
 
25
struct Translation {
 
26
        QString nameCode;
 
27
        QString nameLong;
 
28
        QString nameEnglish;
 
29
        QString author;
 
30
};
 
31
bool operator<(const Translation& t1, const Translation& t2);
 
32
 
 
33
#define CSTR(x)(QTextCodec::codecForLocale()->fromUnicode(x).constData())
 
34
 
25
35
const QIcon& getIcon(const QString& name);
26
36
const QPixmap* getPixmap(const QString& name);
27
37
void createBanner(QPixmap* Pixmap, const QPixmap* IconAlpha,const QString& Text,int Width);
28
 
void createBanner(QPixmap* Pixmap, const QPixmap* IconAlpha,const QString& Text,int Width, QColor Color1, QColor Color2, QColor TextColor);
 
38
void createBanner(QPixmap* Pixmap, const QPixmap* IconAlpha,const QString& Text,int Width,
 
39
                                  QColor Color1, QColor Color2, QColor TextColor);
29
40
void openBrowser(const QString& UrlString);
30
41
void openBrowser(IEntryHandle* entry);
31
42
void showErrMsg(const QString& msg,QWidget* parent=NULL);
33
44
QString makePathRelative(const QString& Abs,const QString& Cur);
34
45
QString getImageFile(const QString& name);
35
46
bool createKeyFile(const QString& filename,QString* err, int length=32, bool Hex=true);
 
47
bool lockPage(void* addr, int len);
 
48
bool unlockPage(void* addr, int len);
 
49
bool syncFile(QFile* file);
 
50
void installTranslator();
 
51
bool isTranslationActive();
 
52
QList<Translation> getAllTranslations();
 
53
#ifdef Q_OS_WIN
 
54
        #ifndef CSIDL_APPDATA
 
55
                #define CSIDL_APPDATA 0x001a // <username>\Application Data
 
56
        #endif
 
57
        QString qtWindowsConfigPath(int type);
 
58
#endif
36
59
 
37
60
#endif //TOOLS_H