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

📄 calldetailsdialog.hpp

📁 一个WinCE6。0下的IP phone的源代码
💻 HPP
字号:
//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this sample source code is subject to the terms of the Microsoft
// license agreement under which you licensed this sample source code. If
// you did not accept the terms of the license agreement, you are not
// authorized to use this sample source code. For the terms of the license,
// please see the license agreement between you and Microsoft or, if applicable,
// see the LICENSE.RTF on your install media or the root of your tools installation.
// THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES.
//
#pragma once

#ifndef __CALLDETAILSDIALOG_HPP__
#define __CALLDETAILSDIALOG_HPP__

#include <windows.h>
#include <atlbase.h>
#include <atlcom.h>
#include <PimStore.h>

#include "voipstore.h"
#include "Dialog.hpp"
#include "Controls.hpp"
#include "resource.h"

typedef HRESULT (STDMETHODCALLTYPE IExchangeClientGALSearchInformation::*pfnGetGalProperty)  (WCHAR *wszBuffer, UINT cchBuffer);
typedef HRESULT (STDMETHODCALLTYPE IContact::*pfnGetContactProperty)  (BSTR* Buffer);

//
// Forward declaration.
//
struct GalDrawingEntry;
struct ContactsDrawingEntry;
struct ContactsAddressDrawingEntry;

class CallDetailsDialog_t : public DialogScreen_t
{
public:
    
    static enum DetailStateCookies_e
    {
        GalName = 1,
        GalPhoneNumber,
        GalOfficeNumber,
        GalEmailAddress,
        ContactHomePhone,
        ContactWorkPhone,
        ContactMobilePhone,
        ContactHomeAddr,
        ContactWorkAddr,
        ContactEmailAddr,
        ContactName,
    };
    
public:
    
    CallDetailsDialog_t(
        InfoApp_t::ScreenId Id, 
        IUnknown*           piInformation
        );
    
    ~CallDetailsDialog_t();
   
    HRESULT
    CreateDialogScreen(
        void
        );

    BOOL
    HookProc(
        HWND hwnd, 
        UINT Message, 
        WPARAM wParam, 
        LPARAM lParam
        );

    int GetHelpStringId() { return IDS_SCREENHELP_DETAILS; }

private:

    HRESULT 
    Enter (
        void
        );
    
    HRESULT 
    TryToGetContactInfo(
        void
        );
        
    HRESULT 
    StartChildRequests (
        void
        );

    HRESULT 
    StartFreeBusyRequest(
        void
        );

    HRESULT 
    StartGalRequest(
        void
        );
    
    HRESULT
    Refresh(
        void
        );

    HRESULT 
    AddGalDisplayItems( 
        void
        );
    
    HRESULT 
    AddContactDisplayItems(
        void
        );
    
    HRESULT 
    AddFreeBusyDisplayItem(
        void
        );    

    HRESULT 
    OnCommand (
        WPARAM wParam
        );

    HRESULT
    OnDial(
        void
        );
    
    HRESULT 
    OnExchangeQueryCompleted(
        IExchangeClientRequest*     piRequest, 
        ExchangeClientRequestStatus ecrs
        );
    
    HRESULT 
    OnFreeBusyRequestSucceeded(
        void
        );
    
    HRESULT 
    OnGalRequestSucceeded(
        void
        );

    HRESULT 
    OnAddToSpeedDial(
        void
        );

    HRESULT 
    GenerateDisplayName(
        WCHAR * pBuffer, 
        UINT    BufferLength
        );
    
    HRESULT 
    GenerateDefaultPhoneNumber(
        WCHAR* pBuffer,
        UINT   BufferLength
        );

    HRESULT 
    GenerateCallerInfoBySelection(
        WCHAR* pUri,
        UINT   UriLength,
        WCHAR* pName,
        UINT   NameLength
        );
    
    HRESULT 
    GetUriBasedOnCookie(
        DWORD  Cookie, 
        WCHAR* pUri, 
        UINT   UriLength
        );    

    HRESULT 
    GetContactAddress(
        BSTR*                Buffer,
        DetailStateCookies_e AddressType
        );

    HRESULT 
    CreateDetailDisplayItems(
        UINT                 Label,
        const WCHAR*         pBuffer,
        DetailStateCookies_e Cookie,
        BOOL                 SupportMultipleLines
        );

private:
    
    InfoApp_t::ScreenId   m_ScreenId;    


    //member data
    SYSTEMTIME                                   m_FreeBusyStartTime;

    //information we have already retrieved
    CComPtr<IContact>                            m_cpContact;
    CComPtr<IExchangeClientGALSearchInformation> m_cpGalInfo;
    CComPtr<IVoIPCallRecord>                     m_cpCallRecord;

    //Requests we have sent out
    CComPtr<IExchangeClientRequest>              m_cpFreeBusyRequest;
    CComPtr<IExchangeClientRequest>              m_cpGalRequest;


private: 
    static const GalDrawingEntry             sc_GalEntries[];    
    static const ContactsDrawingEntry        sc_ContactsEntries[];    
    static const ContactsAddressDrawingEntry sc_ContactsAddressEntries[];    
    static const pfnGetContactProperty       sc_ContactsHomeAddressProperties[];    
    static const pfnGetContactProperty       sc_ContactsOfficeAddressProperties[];
};


//
//  Struct used for table-driven lookup and additions to the list
//
struct GalDrawingEntry
{
    CallDetailsDialog_t::DetailStateCookies_e Cookie;
    UINT                                      Label;
    pfnGetGalProperty                         GetPropertyFn;    
    BOOL                                      SupportMultipleLines; 
};

//
//  Struct used for table-driven lookup and addition to the list
//
struct ContactsDrawingEntry
{
    CallDetailsDialog_t::DetailStateCookies_e  Cookie;
    UINT                                       Label;
    pfnGetContactProperty                      GetPropertyFn;
    BOOL                                       SupportMultipleLines; 		
};

//
//  Struct used for keeping address cookie and the corresponding label.    
//
struct ContactsAddressDrawingEntry
{
    CallDetailsDialog_t::DetailStateCookies_e Cookie;
    UINT                                      Label;
};

#endif

⌨️ 快捷键说明

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