File: wxsqliteplusapp.h

package info (click to toggle)
wxsqlite3 3.0.0.1~dfsg0-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 6,740 kB
  • sloc: cpp: 20,130; sh: 2,837; makefile: 302; ansic: 197; php: 9
file content (160 lines) | stat: -rwxr-xr-x 6,418 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
/*---------------------------------------------------------------------------*/
/* Logiciel de gestion de fichier de base de donnesSQLite                   */
/*---------------------------------------------------------------------------*/
/* Projet  : wxSQLitePlus                              Version  : 0.2.3.0    */
/* Fichier : wxsqliteplusapp.h                                               */
/* Auteur  : Fred Cailleau-Lepetit                     Date     : 04/07/2007 */
/* email   : softinthebox@free.fr                      Rvision : 18/10/2008 */
/*---------------------------------------------------------------------------*/
/* Copyright (C) Fred Cailleau-Lepetit 2007                                  */
/* Licence GNU General Public License  http://www.fsf.org/copyleft/gpl.html  */
/*---------------------------------------------------------------------------*/
/*
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation (version 3).

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

Ce programme est libre, vous pouvez le redistribuer et/ou le modifier
selon les termes de la Licence Publique Gnrale GNU publie par la
Free Software Foundation (version 3).

Ce programme est distribu car potentiellement utile, mais
SANS AUCUNE GARANTIE, ni explicite ni implicite, y compris
les garanties de commercialisation ou d'adaptation dans un but
spcifique. Reportez-vous  la Licence Publique Gnrale GNU
pour plus de dtails.
*/

#ifndef _WXSQLITEPLUSAPP_H_
#define _WXSQLITEPLUSAPP_H_

#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma interface "wxsqliteplusapp.h"
#endif
/*---------------------------------------------------------------------------*/
#include <wx/wxsqlite3.h>
#include "sqliteplusdef.h"
/*---------------------------------------------------------------------------*/
class wxSingleInstanceChecker;
/*---------------------------------------------------------------------------*/
class wxSQLitePlusApp: public wxApp
{
   DECLARE_CLASS(wxSQLitePlusApp)
   DECLARE_EVENT_TABLE()

   public:

      wxSQLitePlusApp();

      void Init();
      virtual bool OnInit();
      virtual int OnExit();

      void AddHistory(const wxString& sql);
      wxSQLite3ResultSet GetStatementHistory();

      void SetParamInt(int param, int value);
      int GetParamInt(int param);
      void SetParamStr(int param, const wxString& value);
      wxString GetParamStr(int param);

      void SetSQLParameter(const wxString& param, const wxString& value);
      wxString GetSQLParameter(const wxString& param);

      wxBitmap GetBmp(int id);
      wxIcon GetIcon(int id);

      wxString GetCompanyName() const;
      wxString GetFileDescription() const;
      wxString GetFileVersion() const;
      wxString GetInternalName() const;
      wxString GetLegalCopyright() const;
      wxString GetOriginalFilename() const;

      void ShowError(const wxString& proc, wxSQLite3Exception& ex) const;

      bool CheckStatementSyntax(wxSQLite3Database* db,
                                const wxString& statement,
                                wxString& error);

      bool GetSavePosition(){return m_SavePosition;}
      bool GetSavePerspective(){return m_SavePerspective;}

      wxString GetStyleFontName(){return m_FontName;}
      int      GetStyleFontSize(){return m_FontSize;}
      bool     GetEdgeLineVisible(){return m_EdgeLineVisible;}
      bool     GetStyleFontBold(int index);
      bool     GetStyleFontItalic(int index);
      bool     GetStyleFontUnderline(int index);
      wxColour GetStyleColourFore(int index);
      wxColour GetStyleColourBack(int index);
      int      GetStyleCase(int index);
      int      GetStyleTabWidth(){return m_StyleTabWidth;}
      bool     GetStyleUseTab(){return m_StyleUseTab;}
      bool     GetStyleTabIndent(){return m_StyleTabIndent;}
      bool     GetStyleBackspaceUnindent(){return m_StyleBackspaceUnindent;}
      int      GetStyleIndentWidth(){return m_StyleIndentWidth;}
      bool     GetStyleShowLineNumber(){return m_StyleShowLineNumber;}
      wxColour GetForeLineNumber(){return m_ForeLineNumber;}
      wxColour GetBackLineNumber(){return m_BackLineNumber;}

      void SetStyleFontName(const wxString& value);
      void SetStyleFontSize(int value);
      void SetEdgeLineVisible(bool value);
      void SetStyleFontBold(int index, bool value);
      void SetStyleFontItalic(int index, bool value);
      void SetStyleFontUnderline(int index, bool value);
      void SetStyleColourFore(int index, wxColour value);
      void SetStyleColourBack(int index, wxColour value);
      void SetStyleCase(int index, int value);

      unsigned short GetService();
      void SetService(unsigned short port);

   private:

      wxSingleInstanceChecker* m_checker;
      wxSQLite3Database m_db;
      bool m_SavePosition;
      bool m_SavePerspective;
      wxString m_FontName;
      int m_FontSize;
      bool m_EdgeLineVisible;
      bool m_FontBold[STYLE_COUNT];
      bool m_FontItalic[STYLE_COUNT];
      bool m_FontUnderline[STYLE_COUNT];
      wxColour m_FontFore[STYLE_COUNT];
      wxColour m_FontBack[STYLE_COUNT];
      int m_StyleCase[STYLE_COUNT];
      int m_StyleTabWidth;
      bool m_StyleUseTab;
      bool m_StyleTabIndent;
      bool m_StyleBackspaceUnindent;
      int m_StyleIndentWidth;
      bool m_StyleShowLineNumber;
      wxColour m_ForeLineNumber;
      wxColour m_BackLineNumber;

      int QueryGetParam(const wxString& param, int defvalue);
      void QuerySetParam(const wxString& param, int value);
      wxString QueryGetParam(const wxString& param, const wxString& defvalue);
      void QuerySetParam(const wxString& param, const wxString& value);

      wxString Normalize(const wxString& str);
      unsigned long CalcCrc32(const void* pData, unsigned long uSize);
      unsigned long CalcCrc32(const wxString& str);

      void InitConfig();

      wxString GetIPCFile();

};
/*---------------------------------------------------------------------------*/
DECLARE_APP(wxSQLitePlusApp)
/*---------------------------------------------------------------------------*/
#endif   // _WXSQLITEPLUSAPP_H_