⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 uidlg.h

📁 funambol windows mobile plugin source code, the source code is taken from the funambol site
💻 H
字号:
/*
 * Copyright (C) 2003-2007 Funambol, Inc
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY, TITLE, NONINFRINGEMENT or FITNESS FOR A PARTICULAR
 * PURPOSE.  See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 * 02111-1307  USA
 */

// uiDlg.h : header file
//


#pragma once
#include "afxwin.h"
#include "CustomButton.h"

#include "CustomList.h"

#if defined(WIN32_PLATFORM_PSPC)
    #include "aygshell.h" // shmenubarinfo
#endif


class CuiDlg : public CDialog
{
// Construction
public:
     CuiDlg(CWnd* pParent = NULL);	// standard constructor



// Dialog Data
    enum { IDD = IDD_UI_DIALOG };

protected:
    SHMENUBARINFO dlgCommandBar;
    void CreateMenuBar(const int id);

    bool bSyncStarted;
    int currentSource;

    // bitmask, to see if for a source was received a SyncSourceEnded event
    unsigned long sourceEnds;

    // bitmask, to see if for a source was received a SyncSourceBegin event
    unsigned long sourceBegins;

    int totalItems;
    bool resetCurrentItem;
    int lastItem;
    int currentItem;
    bool bSyncCanceled;

    int nMailsToSync;

    bool isInSettings; // if a settings child window is opened

    // what source will be synced first, used for displaying the 'Connecting' message
    int firstSourceId;

    // sync source states {SYNCSOURCE_STATE_OK, SYNCSOURCE_STATE_NOT_SYNCED, SYNCSOURCE_STATE_CANCELED}
    int syncSourceContactState, syncSourceCalendarState;
    int syncSourceTaskState, syncSourceNoteState;
    int syncSourceMailState, syncSourceBriefcaseState;

    HICON m_hIcon;
    CCustomList lstSources;

    // checks the sources to find which source will be synced first, sets firstSourceId variable
    void setFirstSourceToSync();

    // inits the sync controls in the main window
    void initSyncControls();


    /* if there are sources which were recovered with 'refresh-local' or
    'refresh-server' then we set them to 'two-way' */
    //void refreshRecoveredSources();

    void lockPanes();
    void unlockPanes();
    void refreshCanceledState();

    bool isSyncEnabled();

    virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
    virtual BOOL OnInitDialog();
    virtual BOOL PreTranslateMessage(MSG* pMsg);

    #if defined(_DEVICE_RESOLUTION_AWARE) && !defined(WIN32_PLATFORM_WFSP)
	    afx_msg void OnSize(UINT /*nType*/, int /*cx*/, int /*cy*/);
    #endif

    DECLARE_MESSAGE_MAP()

public:
    void refreshSourcePane(int id);
    void refreshSourcePanes();

    afx_msg void OnContextMenuSync();
    afx_msg void OnContextMenuSettings();

    // startsync exit code as lParam
    afx_msg LRESULT OnStartsyncEnded(WPARAM , LPARAM);

    afx_msg LRESULT OnStartingSync(WPARAM , LPARAM);
    afx_msg LRESULT OnStartingSource(WPARAM , LPARAM);
    void OnMsgItemSynced(WPARAM , LPARAM, bool);
    afx_msg LRESULT OnMsgTotalItems(WPARAM , LPARAM);
    afx_msg LRESULT OnMsgItemSyncedFromServer(WPARAM , LPARAM);
    afx_msg LRESULT OnMsgItemSyncedFromClient(WPARAM , LPARAM);
    afx_msg LRESULT OnMsgSourceState(WPARAM , LPARAM);
    afx_msg LRESULT OnMsgEndingSource(WPARAM , LPARAM);
    afx_msg LRESULT OnMsgConnecting(WPARAM , LPARAM);
    afx_msg LRESULT OnMsgEndingSync(WPARAM , LPARAM);

    afx_msg void OnMenuAbout();
    afx_msg void OnMenuStop();
    afx_msg void OnMenuPush();
    afx_msg void OnMenuComm();
    afx_msg void OnMenuSync();
    afx_msg void OnMenuLoglevel();
    afx_msg void OnSync();
    afx_msg void OnMenuExit();
    afx_msg void OnMenuRecover();
    afx_msg void OnOK();
    afx_msg void OnCancel();
    afx_msg void OnClose();
    afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor );
    afx_msg void OnItemchangedList1(NMHDR* pNMHDR, LRESULT* pResult);
    afx_msg void OnContextMenu(CWnd* /*pWnd*/, CPoint /*point*/);

    void setFirstSourceToSync(int id) {firstSourceId = id;}

    CCustomList& getSourceListCtrl() {return lstSources; }

    // source with index <index> has been activated
    void SelectSource(int index);

    // starts the sync
    void StartSync(CString param);
    void CancelSync();

    afx_msg void OnToolsDeviceinfo();
    void EnableSyncButton(bool bEnable);
};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -