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

📄 freebusydisplayitem.h

📁 一个WinCE6。0下的IP phone的源代码
💻 H
字号:
//
// 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 __FREEBUSYDISPLAYITEM_H__
#define __FREEBUSYDISPLAYITEM_H__

#include "string.hxx"

#include "DisplayItem.hpp"
#include <atlbase.h>

/*------------------------------------------------------------------------------
    CFreeBusyDisplayItem
    
    implementation of a FreeBusy display item
------------------------------------------------------------------------------*/
class CFreeBusyDisplayItem : public CVoIPDisplayItem
{
public:
    static const UINT c_siDisplayName    = 0;
    static const UINT c_siFreeBusyStatus = 1;
    static const UINT c_siFreeBusyData   = 2;
    static const UINT c_siBoundaries     = 3;
    
public:
    //Ctor
    CFreeBusyDisplayItem();
   ~CFreeBusyDisplayItem();
   
public:
    //public accessors
    HRESULT SetDisplayName   (
        const WCHAR *c_wszDisplayName
        );
    
    HRESULT SetFreeBusyStatus(
        const WCHAR *c_wszFreeBusyStatus,
        SYSTEMTIME  *pstStart
        );

    HRESULT GetSubItemText(
        int idxSubItem, 
        WCHAR * wszBuffer, 
        UINT cchBuffer
        );

    HRESULT GetText(
        WCHAR * wszBuffer, 
        INT cchBuffer
        );

    BOOL NeedsToolTip(
        RECT *prc
        ); 

public:
    //IVoIPDisplayItem
    virtual HRESULT Draw(
        HDC hdc, 
        const RECT * prc, 
        BOOL fSelected, 
        BOOL fTopItem = FALSE
        );

    virtual BOOL GetHeight(
        UINT * pfHeight
        );
    
protected:
    //Helper functions
    virtual HRESULT DrawMain(
        HDC hdc, 
        const RECT *prc
        );
    
    HRESULT DrawName(
        HDC hdc, 
        const RECT * prc
        );

    HRESULT GetFreeBusyTitle(
        WCHAR * wszTitle, 
        UINT cchTitle
        );
    
    HRESULT DrawFreeBusyTitle(
        HDC hdc, 
        const RECT * prc
        );

    HRESULT DrawFreeBusyGraphics(
        HDC hdc, 
        const RECT * prc
        );

    HRESULT DrawPresenceIcon(
        HDC hdc,
        const RECT *prc
        );

    BOOL    HasFreeBusyData() { return m_wstrFreeBusy[0] != 0; }

private:
    ce::wstring m_wstrDisplayName;
    ce::wstring m_wstrFreeBusy; 
    SYSTEMTIME  m_stStart;
};
#endif

⌨️ 快捷键说明

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