📄 global.h
字号:
#ifndef _H_GLOBAL
#define _H_GLOBAL
#include "StdAfx.h"
#include "sqlite3.h"
extern sqlite3 *db;
extern sqlite3 *channelDB;
BOOL getImageDir(char *path,int &length);
CBitmap* getImage(char *fullpath);
void setMenuItemBitmapsByFileName(CMenu *menu,int position,char *name);
void buildImageList(CImageList *imageList,char **names,int size);
enum OperatorType{
_NEWCHANNEL,_DELETECHANNEL,_NEWCATEGORY,_DELETECATEGRY,_MODIFYCOTEGORY
};
class DateTime
{
public:
DateTime(char *time);
bool operator<(const DateTime& other);
char *toString();
~DateTime(){}
protected:
private:
int date;
int time;
};
struct ItemList{
int id;
bool isRead;//项是否已读
char *url;//详细信息对应的URL
char *title;//标题
char *author;//作者
char *description;//简介
char *time;//发布时间
static int nextID;
ItemList *nextItem;//下一条记录
ItemList(char *url,char *title,char *author,char *description,char *pubTime,int isRead = 0,int id=-1);
ItemList(){
this->author = NULL;
this->url = NULL;
this->title = NULL;
this->time = NULL;
this->description = NULL;
}
friend ItemList *operator+(ItemList *left,ItemList &right);
~ItemList();
};
struct Channel
{
char *source;
char *pubTime;
char *title;
ItemList *items;
Channel(char *source,char *time,char *title,ItemList *items = NULL);
~Channel();
};
struct MyTreeNode
{
MyTreeNode *nextSubling;//下一个兄弟节点
int type;//0表示目录,1表示频道,2表示收藏
int id;//标识符,在数据库里面使用
char* name;//频道名称或者分类名
static int nextID;//下一个可用的id
MyTreeNode(char* name,int id);
virtual ~MyTreeNode();
};
struct DirNode : public MyTreeNode
{
MyTreeNode *firstChild;//第一个子节点,显示在该节点子节点的最下方
DirNode(char *name,int id=-1);
~DirNode();
};
struct ChannelNode : public MyTreeNode
{
char *url;
char *pubTime;
ChannelNode(char* name,char* url = NULL,char *time = NULL,int id=-1);
~ChannelNode();
};
struct CollectionNode : public MyTreeNode
{
char *url;
CollectionNode(char* name,char* url = NULL,int id=-1);
~CollectionNode();
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -