uidlg.h

来自「funambol window mobile客户端源代码」· C头文件 代码 · 共 194 行

H
194
字号
/*
 * Funambol is a mobile platform developed by Funambol, Inc. 
 * 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 Affero General Public License version 3 as published by
 * the Free Software Foundation with the addition of the following permission
 * added to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED
 * WORK IN WHICH THE COPYRIGHT IS OWNED BY FUNAMBOL, FUNAMBOL DISCLAIMS THE
 * WARRANTY OF NON INFRINGEMENT  OF THIRD PARTY RIGHTS.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 
 * details.
 * 
 * You should have received a copy of the GNU Affero General Public License
 * along with this program; if not, see http://www.gnu.org/licenses or write to
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 * MA 02110-1301 USA.
 * 
 * You can contact Funambol, Inc. headquarters at 643 Bair Island Road, Suite
 * 305, Redwood City, CA 94063, USA, or at email address info@funambol.com.
 * 
 * The interactive user interfaces in modified source and object code versions
 * of this program must display Appropriate Legal Notices, as required under
 * Section 5 of the GNU Affero General Public License version 3.
 * 
 * In accordance with Section 7(b) of the GNU Affero General Public License
 * version 3, these Appropriate Legal Notices must retain the display of the
 * "Powered by Funambol" logo. If the display of the logo is not reasonably
 * feasible for technical reasons, the Appropriate Legal Notices must display
 * the words "Powered by Funambol".
 */

// 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

using namespace std;

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;
    bool openUp;

    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);

    afx_msg void OnSize(UINT /*nType*/, int /*cx*/, int /*cy*/);

    afx_msg void OnInitMenuPopup(CMenu *pPopupMenu, UINT nIndex, BOOL bSysMenu);


    // it is used to decide if reset the counter of the total item.
    bool resetTheItem;
    // it is used to populate the message without the default message
    CString messageToWrite;

    DECLARE_MESSAGE_MAP()

public:
    void refreshSourcePane(int id);
    void refreshSourcePanes();
    wstring getFormattedDateAndTime(long lastSync);

    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 LRESULT OnMsgPopup(WPARAM wParam, LPARAM lParam);
    afx_msg LRESULT OnOKMsg(WPARAM wParam, LPARAM lParam);
    
    afx_msg LRESULT OnMsgTotalItemsNew(WPARAM wParam, LPARAM lParam);
    afx_msg LRESULT OnMsgTotalItemsMod(WPARAM wParam, LPARAM lParam);
    afx_msg LRESULT OnMsgTotalItemsDel(WPARAM wParam, LPARAM 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*/);

    afx_msg void OnUpdateProcedure();

    afx_msg void OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized);

    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 + =
减小字号Ctrl + -
显示快捷键?