00001 #ifndef CUSTOMEDIT_H_ 00002 #define CUSTOMEDIT_H_ 00003 00004 #include "mythplayer.h" 00005 #include "programinfo.h" 00006 #include "mythscreentype.h" 00007 00008 class MythUITextEdit; 00009 class MythUIButton; 00010 class MythUIButtonList; 00011 class MythUIButtonListItem; 00012 00013 class CustomEdit : public MythScreenType 00014 { 00015 Q_OBJECT 00016 public: 00017 00018 explicit CustomEdit(MythScreenStack *parent, ProgramInfo *m_pginfo = NULL); 00019 ~CustomEdit(void); 00020 00021 bool Create(); 00022 bool keyPressEvent(QKeyEvent *); 00023 void customEvent(QEvent *event); 00024 00025 protected slots: 00026 void ruleChanged(MythUIButtonListItem *item); 00027 void textChanged(void); 00028 void clauseChanged(MythUIButtonListItem *item); 00029 void clauseClicked(MythUIButtonListItem *item); 00030 void testClicked(void); 00031 void recordClicked(void); 00032 void storeClicked(void); 00033 void scheduleCreated(int); 00034 00035 private: 00036 void loadData(void); 00037 void loadClauses(void); 00038 bool checkSyntax(void); 00039 void storeRule(bool is_search, bool is_new); 00040 void deleteRule(void); 00041 QString evaluate(QString clause); 00042 00043 ProgramInfo *m_pginfo; 00044 QString m_baseTitle; 00045 00046 int m_maxex; 00047 bool m_evaluate; 00048 00049 QString m_seSuffix; 00050 QString m_exSuffix; 00051 00052 MythUIButtonList *m_ruleList; 00053 MythUIButtonList *m_clauseList; 00054 00055 MythUITextEdit *m_titleEdit; 00056 00057 // Contains the SQL statement 00058 MythUITextEdit *m_descriptionEdit; 00059 00060 // Contains the additional SQL tables 00061 MythUITextEdit *m_subtitleEdit; 00062 00063 MythUIText *m_clauseText; 00064 MythUIButton *m_testButton; 00065 MythUIButton *m_recordButton; 00066 MythUIButton *m_storeButton; 00067 MythUIButton *m_cancelButton; 00068 }; 00069 00070 struct CustomRuleInfo { 00071 QString recordid; 00072 QString title; 00073 QString subtitle; 00074 QString description; 00075 }; 00076 00077 Q_DECLARE_METATYPE(CustomRuleInfo) 00078 00079 #endif
1.6.3