#ifndef MASTERCTRL_H
#define MASTERCTRL_H

#include "GlobalDefine.h"
#include "SystemTrayManager.h"
#include "SettingsWindow.h"
#include "ProgramSettings.h"
//#include "AppIconWidget.h"
//#include "MainPanel.h"
#include "SMSMasterCtrlInterface.h"
#include "SMSDatabase.h"
#include "ContactRepository.h"
#include "SMSGui.h"



class CSMSClient : public QObject
{
    Q_OBJECT
public:
    CSMSClient(CSMSGui *GuiHandle, CVoipMSSMSSettings *ProgramSettings);
    ~CSMSClient();

    void Start(void);

    CSMSMasterCtrlInterface *mMasterCtrlIF;
    CSMSDatabase mSMSDatabase;
    CContactRepository mContactRepository;
    CSMSGui *mGuiHandle;
    CVoipMSSMSSettings *mSettings;
    CSystemTrayManager *mTrayIconMgr;




    int SetAllMsgsDatabase(QString DID, QList<CSMSMessage> *MessagesList);
    int SetDIDDatabase(QString DID);
    int NewMessagesEvent(QList<CSMSMessage> *MessagesList);
    int SetContacts(QList<CContact> *ContactsList);


    //ConversationsWindow requests
    int ShowConversation(QString Contact);


    //ConversationWindow requests
    int SendSMSMessage(CSMSMessage Message);

    //SMSDatabase requests
    int NewMessageNotification(CSMSConversation* Conversation, int MessageIndex);
    int SyncConversations();
    int MessageCountChangeNotification(int MsgCount);


private:

    CSettings mSMSClientSettings;
};

#endif // MASTERCTRL_H
