1#ifndef TAUPIE_GUI_INCLUDED
2#define TAUPIE_GUI_INCLUDED
18#define SQL_DIR L"sql\\"
22#define SUBCLASS_PROJECT_ID 1
23#define SUBCLASS_TABLE_ID 2
24#define SUBCLASS_QUERYEDIT_ID 3
25#define SUBCLASS_QUERYERROR_ID 4
26#define SUBCLASS_QUERYEXECUTE_ID 5
41int RecordImportedFile(
const wchar_t *tableName,
const wchar_t *fileName,
int pathLevel);
55int64_t
DataView_Update(HWND hwnd, HWND *pListView, RECT *rListView, sqlite3 **db,
const wchar_t *command,
int useTmp);
56int64_t
DataView_UpdateWithAFile(HWND hwnd, HWND *pListView, RECT *rListView, sqlite3 **db,
wchar_t **command,
const wchar_t *fileName);
59LRESULT CALLBACK
DataView_Procedure(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData);
73LRESULT CALLBACK
ProjectTree_Procedure(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData);
78int RecordExecutedAction(
const wchar_t *action,
const wchar_t *dotCommand,
const wchar_t *query,
const wchar_t *error);
86LRESULT CALLBACK
QueryError_Procedure(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData);
87LRESULT CALLBACK
QueryEdit_Procedure(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData);
88LRESULT CALLBACK
QueryExecute_Procedure(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData);
96void Main_OnCommand(HWND hwnd,
int id, HWND hwndCtl, UINT codeNotify);
99void Main_OnSize(HWND hwnd, UINT state, UINT x, UINT y);
103LRESULT CALLBACK
Main_Procedure(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
105LRESULT CALLBACK
Options_Procedure(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
void Main_OnContextMenu(HWND hwnd, HWND hwndContext, short int xPos, short int yPos)
Gestion du menu contextuel.
int Main_OnNotify_DrawDataView(HWND hwnd, LPNMLVCUSTOMDRAW lplvcd)
Redessine sur demande le listview (police, couleur, fond).
int64_t ProjectTree_Update(HWND hwnd)
Crée un TreeView à partir du contenu de la base courante, et l'affiche aux bonnes dimensions.
int64_t DataView_Update(HWND hwnd, HWND *pListView, RECT *rListView, sqlite3 **db, const wchar_t *command, int useTmp)
Crée un ListView à partir d'une commande SQL, et l'affiche aux bonnes dimensions.
void Main_OnClose(HWND hwnd)
Supprime les fichiers temporaires et ferme l'application.
void Main_OnSize(HWND hwnd, UINT state, UINT x, UINT y)
Gestion d'un changement de taille de la fenêtre principale.
void QueryBar_Update(const wchar_t *errorMsg, const wchar_t *request)
Définit le contenu de la QueryBar.
int RecordExecutedAction(const wchar_t *action, const wchar_t *dotCommand, const wchar_t *query, const wchar_t *error)
Enregistrement dans l'historique d'une action de l'utilisateur.
LRESULT CALLBACK QueryEdit_Procedure(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData)
sous-procédure spécifique de la fenêtre d'écriture de requête.
BOOL Main_OnNotify(HWND hwnd, int idCtrl, LPNMHDR pnmh)
Gestion des notifications des composants de la fenêtre principale.
void QueryBar_Create(HWND hwnd)
Création de l'espace de saisie des requêtes.
void ProjectTree_Open(HWND hwnd, int option)
Ouvre/crée un projet Taupie.
LRESULT CALLBACK Main_Procedure(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
procédure de la fenêtre principale.
void Main_OnNotify_ApplyFilter(HWND hHeader)
Application du filtre courant à la vue courante des données.
void ProjectTree_Close(HWND hwnd)
Ferme le projet courant Taupie.
void DataView_Close(HWND hwnd)
Ferme la table sélectionnée dans le ProjectTree.
void ProjectTree_Enlarge(void)
redimensionne en largeur le ProjectTree.
int64_t ExecuteCustomSQLQuery(HWND hwnd)
Exécute une requête demandée par l'utilisateur.
int64_t ExecuteSQLScript(HWND hwnd, const wchar_t *fileName)
Exécute une requête demandée par l'utilisateur.
void RestartScrollingTimer(HWND hwnd)
Relance la temporisation du DataView.
BOOL Main_OnCreate(HWND hwnd, LPCREATESTRUCT lpCreateStruct)
Initialisation de la fenêtre principale.
int64_t CreateCSVFromView(HWND hwnd)
Crée une table dans la base courante à partir d'un fichier CSV.
void Main_OnPaint(HWND hwnd)
redessine la boîte de dialogue.
void Clean(void)
Supprime les fichiers temporaires de l'application.
int ProjectTree_DeleteTable(HWND hwnd)
Supprime une table dans l'arbre du projet.
int ProjectTree_SelectTableByName(const wchar_t *tableName)
Recherche et sélectionne dans l'arbre du projet une table identifiée par son nom. Limite la recherche...
int64_t ProjectTree_ViewAppTable(HWND hwnd, int id)
Affiche une table "système", non présente dans l'arbre du projet.
int Main_OnNotify_FillDataView(LPNMLVDISPINFOW lplvdi)
remplissage des items du DataView à la demande.
void SetVisibility(int project, int table, int query)
définit la visibilité des trois composants de l'écran.
LRESULT CALLBACK Options_Procedure(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
procédure du dialogue des options de ModuleTicket.
int64_t DataView_UpdateWithAFile(HWND hwnd, HWND *pListView, RECT *rListView, sqlite3 **db, wchar_t **command, const wchar_t *fileName)
int ProjectTree_RenameTable(HWND hwnd, const wchar_t *oldTableName, const wchar_t *newTableName)
Renomme une table dans l'arbre du projet.
const wchar_t * GetCellValue(LVHITTESTINFO hti)
Fonction permettant de récupérer le texte d'une cellule sélectionnée.
void StatusBar_Update(const wchar_t *tableName, int64_t records)
Définit le contenu de la barre de statut principale.
LRESULT CALLBACK QueryExecute_Procedure(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData)
sous-procédure spécifique du bouton de lancement de la requête.
LRESULT CALLBACK DataView_Procedure(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData)
sous-procédure spécifique de la vue des données (DataView).
LRESULT CALLBACK ProjectTree_Procedure(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData)
sous-procédure spécifique de la vue du projet (TreeView).
void Main_OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify)
Gère les commandes de l'application.
void ProjectTree_ViewSelectedTable(HWND hwnd, HTREEITEM hItem)
Gère la sélection d'une table dans l'arbre du projet.
int64_t CreateTableFromCSV(HWND hwnd)
Crée une table dans la base courante à partir d'un fichier CSV.
LRESULT CALLBACK QueryError_Procedure(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData)
sous-procédure spécifique de la fenêtre d'affichage de requête.
int RecordImportedFile(const wchar_t *tableName, const wchar_t *fileName, int pathLevel)
Enregistrement des caractéristiques d'un fichier importé comme table.