176 lines
4.6 KiB
C++
176 lines
4.6 KiB
C++
/*/////////////////////////////////////////////////////////////////////////////*/
|
|
/**/
|
|
/* Public header file Data used by WAW*/
|
|
/**/
|
|
/*/////////////////////////////////////////////////////////////////////////////*/
|
|
|
|
/* To avoid unnecessary includes : */
|
|
#ifndef __WAW_DATA_HPP
|
|
#define __WAW_DATA_HPP
|
|
|
|
#include <afxtempl.h>
|
|
|
|
/**************************************/
|
|
#if !defined(CPA_EXPORT)
|
|
#if defined(CPA_WANTS_IMPORT)
|
|
#define CPA_EXPORT __declspec(dllimport)
|
|
#elif defined(CPA_WANTS_EXPORT)
|
|
#define CPA_EXPORT __declspec(dllexport)
|
|
#else
|
|
#define CPA_EXPORT
|
|
#endif /*CPA_WANTS_IMPORT || CPA_WANTS_EXPORT*/
|
|
#endif /*CPA_EXPORT*/
|
|
/**************************************/
|
|
|
|
/*#ifdef __cplusplus*/
|
|
/*extern "C" {*/
|
|
/*#endif /* __cplusplus **/
|
|
|
|
|
|
/* For Global declaration in C files : */
|
|
#ifdef WAW_GLOBALS
|
|
#define __WAW_EXTERN extern
|
|
#else /* !WAW_GLOBALS */
|
|
#define __WAW_EXTERN
|
|
#endif /* !AID_GLOBALS */
|
|
|
|
/*
|
|
-----------------------------------------------------------------------------
|
|
INCLUDES FILES :
|
|
Include here any other header files of your module you need !
|
|
Ex :
|
|
#include "toto.h"
|
|
Note : Do Not include header files from other Modules (do this in C files
|
|
only)
|
|
-----------------------------------------------------------------------------
|
|
*/
|
|
|
|
class WAW_DataList;
|
|
|
|
/*
|
|
-----------------------------------------------------------------------------
|
|
CONSTANT DECLARATION:
|
|
Ex :
|
|
#define WAW_C_LMAX 100
|
|
-----------------------------------------------------------------------------
|
|
*/
|
|
|
|
/*
|
|
-----------------------------------------------------------------------------
|
|
TYPES DEFINITION :
|
|
Declare here any type you need, and constant you need to do this :
|
|
Ex : typedef struct WAW_tdstToto_
|
|
{
|
|
long aLMAX_lBuffer[WAW_C_LMAX];
|
|
...
|
|
} WAW_tdst_Toto ;
|
|
-----------------------------------------------------------------------------
|
|
*/
|
|
|
|
typedef enum WAW_tdeMessage_
|
|
{
|
|
WAW_eDeletedData,
|
|
WAW_eDeletedNode,
|
|
WAW_eUpdateData,
|
|
WAW_eHideWindow,
|
|
WAW_eShowWindow,
|
|
WAW_eNbOfMessage
|
|
} WAW_tdeMessage;
|
|
|
|
typedef void(*WAW_CallBack)( WAW_tdeMessage, void*);
|
|
|
|
typedef struct WAW_tdstUserInfo_
|
|
{
|
|
CString m_csUserModuleName;
|
|
WAW_CallBack m_pfnCallBack;
|
|
} WAW_tdstUserInfo;
|
|
|
|
|
|
typedef WAW_tdstUserInfo * WAW_hUserInfo;
|
|
|
|
|
|
class CPA_EXPORT WAW_Data
|
|
{
|
|
protected:
|
|
WAW_Data( CString, CString, WAW_tdstUserInfo* ,void* _pvData = NULL );
|
|
~WAW_Data();
|
|
|
|
/* members :*/
|
|
public:
|
|
protected:
|
|
private:
|
|
CString m_pri_csDataName;
|
|
CString m_pri_csDataValue;
|
|
void* m_pri_pvUserData;
|
|
|
|
WAW_tdstUserInfo * m_pri_pstUserInfo;
|
|
HTREEITEM m_pri_hTreeItem;
|
|
BOOL m_pri_bIsData;
|
|
BOOL m_pri_bVisible;
|
|
|
|
/* functions :*/
|
|
public:
|
|
WAW_Data* m_pub_fn_pclGetParentData();
|
|
CString m_pub_fn_csGetDataName() {return m_pri_csDataName;}
|
|
void * m_pub_fn_pvGetUserData() {return m_pri_pvUserData;}
|
|
|
|
void m_pub_fn_vSetUserData( void * _pvData ) { m_pri_pvUserData = _pvData; }
|
|
|
|
protected:
|
|
|
|
private:
|
|
|
|
/* friends of the class*/
|
|
friend extern CPA_EXPORT WAW_Data * WAW_fn_pclAddData( WAW_hUserInfo, WAW_Data* , CString, CString, void* );
|
|
friend extern CPA_EXPORT WAW_Data * WAW_fn_pclAddNode( WAW_hUserInfo,WAW_Data* , CString, void* );
|
|
friend extern CPA_EXPORT BOOL WAW_fn_bUpdateData( WAW_Data*, CString );
|
|
friend extern CPA_EXPORT BOOL WAW_fn_bDeleteData( WAW_Data* );
|
|
friend extern CPA_EXPORT BOOL WAW_fn_bSetDataIcon( WAW_Data*, HICON, HICON );
|
|
friend extern BOOL WAW_fn_bCheckForEmptyNode( HTREEITEM );
|
|
|
|
friend class WAW_MainDialog;
|
|
friend class WAW_DataList;
|
|
/* friend class WAW_DataList;*/
|
|
};
|
|
|
|
/*
|
|
-----------------------------------------------------------------------------
|
|
GLOBAL VARIABLE DECLARATION :
|
|
Ex :
|
|
__AID_EXTERN <type> <variable name>
|
|
#ifdef AID_GLOBALS
|
|
= <initial values>
|
|
#endif
|
|
;
|
|
-----------------------------------------------------------------------------
|
|
*/
|
|
|
|
/*
|
|
-----------------------------------------------------------------------------
|
|
PUBLIC FUNCTIONS DECLARATION:
|
|
Ex :
|
|
extern CPA_EXPORT void WAW_fn_vMyPublicFunction(void);
|
|
Note : Public functions declaration must be done in PUBLIC HEADER files (.h)
|
|
in your Inc directory
|
|
-----------------------------------------------------------------------------
|
|
*/
|
|
|
|
|
|
/*
|
|
-----------------------------------------------------------------------------
|
|
PRIVATE FUNCTIONS DECLARATION:
|
|
Ex :
|
|
extern void WAW_fn_vMyPrivateFunction(void);
|
|
Note : Private functions MUST appear ONLY in PRIVATE HEADER files (.h) in
|
|
your Src directory with source files (.c)
|
|
-----------------------------------------------------------------------------
|
|
*/
|
|
|
|
|
|
/*#ifdef __cplusplus*/
|
|
/*};*/
|
|
/*#endif /* __cplusplus */
|
|
|
|
|
|
#endif /* __WAW_USER_HPP */
|