ReactOS 0.4.15-dev-8116-gf69e256
CBalloonQueue Class Reference
Collaboration diagram for CBalloonQueue:

Classes

struct  Info
 

Public Member Functions

 CBalloonQueue ()
 
void Init (HWND hwndParent, CNotifyToolbar *toolbar, CTooltips *balloons)
 
void Deinit ()
 
bool OnTimer (int timerId)
 
void UpdateInfo (InternalIconData *notifyItem)
 
void RemoveInfo (InternalIconData *notifyItem)
 
void CloseCurrent ()
 

Static Public Attributes

static const int TimerInterval = 2000
 
static const int BalloonsTimerId = 1
 
static const int MinTimeout = 10000
 
static const int MaxTimeout = 30000
 
static const int CooldownBetweenBalloons = 2000
 

Private Member Functions

int IndexOf (InternalIconData *pdata)
 
void SetTimer (int length)
 
void Show (Info &info)
 
void Close (IN OUT InternalIconData *notifyItem, IN UINT uReason)
 

Private Attributes

HWND m_hwndParent
 
CTooltipsm_tooltips
 
CAtlList< Infom_queue
 
CNotifyToolbarm_toolbar
 
InternalIconDatam_current
 
bool m_currentClosed
 
int m_timer
 

Detailed Description

Definition at line 85 of file syspager.cpp.

Constructor & Destructor Documentation

◆ CBalloonQueue()

CBalloonQueue::CBalloonQueue ( )

Definition at line 503 of file syspager.cpp.

503 :
508 m_currentClosed(false),
509 m_timer(-1)
510{
511}
HWND m_hwndParent
Definition: syspager.cpp:115
CTooltips * m_tooltips
Definition: syspager.cpp:117
CNotifyToolbar * m_toolbar
Definition: syspager.cpp:121
bool m_currentClosed
Definition: syspager.cpp:124
InternalIconData * m_current
Definition: syspager.cpp:123
#define NULL
Definition: types.h:112

Member Function Documentation

◆ Close()

void CBalloonQueue::Close ( IN OUT InternalIconData notifyItem,
IN UINT  uReason 
)
private

Definition at line 645 of file syspager.cpp.

646{
647 TRACE("HideBalloonTip called\n");
648
649 if (m_current == notifyItem && !m_currentClosed)
650 {
652
653 // Prevent Re-entry
654 m_currentClosed = true;
657 }
658}
static const int CooldownBetweenBalloons
Definition: syspager.cpp:92
void SetTimer(int length)
Definition: syspager.cpp:612
bool SendNotifyCallback(InternalIconData *notifyItem, UINT uMsg)
Definition: syspager.cpp:1079
VOID TrackDeactivate()
Definition: rosctrls.h:723
#define TRACE(s)
Definition: solgame.cpp:4

◆ CloseCurrent()

void CBalloonQueue::CloseCurrent ( )

Definition at line 593 of file syspager.cpp.

594{
595 if (m_current != NULL)
596 {
597 Close(m_current, NIN_BALLOONTIMEOUT);
598 }
599}
@ Close
Definition: sacdrv.h:268

Referenced by CSysPagerWnd::OnBalloonPop().

◆ Deinit()

void CBalloonQueue::Deinit ( )

Definition at line 520 of file syspager.cpp.

521{
522 if (m_timer >= 0)
523 {
525 }
526}
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)

Referenced by CSysPagerWnd::OnDestroy().

◆ IndexOf()

int CBalloonQueue::IndexOf ( InternalIconData pdata)
private

Definition at line 601 of file syspager.cpp.

602{
603 int count = m_toolbar->GetButtonCount();
604 for (int i = 0; i < count; i++)
605 {
606 if (m_toolbar->GetItemData(i) == pdata)
607 return i;
608 }
609 return -1;
610}
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static PROTOCOLDATA * pdata
Definition: protocol.c:158

Referenced by Show().

◆ Init()

void CBalloonQueue::Init ( HWND  hwndParent,
CNotifyToolbar toolbar,
CTooltips balloons 
)

Definition at line 513 of file syspager.cpp.

514{
516 m_toolbar = toolbar;
517 m_tooltips = balloons;
518}
static HWND hwndParent
Definition: cryptui.c:300

Referenced by CSysPagerWnd::OnCreate().

◆ OnTimer()

bool CBalloonQueue::OnTimer ( int  timerId)

Definition at line 528 of file syspager.cpp.

529{
530 if (timerId != m_timer)
531 return false;
532
534 m_timer = -1;
535
537 {
538 Close(m_current, NIN_BALLOONTIMEOUT);
539 }
540 else
541 {
542 m_current = NULL;
543 m_currentClosed = false;
544 if (!m_queue.IsEmpty())
545 {
546 Info info = m_queue.RemoveHead();
547 Show(info);
548 }
549 }
550
551 return true;
552}
CAtlList< Info > m_queue
Definition: syspager.cpp:119
void Show(Info &info)
Definition: syspager.cpp:617
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:690

Referenced by CSysPagerWnd::OnTimer().

◆ RemoveInfo()

void CBalloonQueue::RemoveInfo ( InternalIconData notifyItem)

Definition at line 578 of file syspager.cpp.

579{
580 Close(notifyItem, NIN_BALLOONHIDE);
581
582 POSITION position = m_queue.GetHeadPosition();
583 while(position != NULL)
584 {
585 Info& info = m_queue.GetNext(position);
586 if (info.pSource == notifyItem)
587 {
588 m_queue.RemoveAt(position);
589 }
590 }
591}

Referenced by CNotifyToolbar::RemoveButton().

◆ SetTimer()

void CBalloonQueue::SetTimer ( int  length)
private

Definition at line 612 of file syspager.cpp.

613{
615}
static const int BalloonsTimerId
Definition: syspager.cpp:89
GLuint GLsizei GLsizei * length
Definition: glext.h:6040

Referenced by Close(), SetTimer(), and Show().

◆ Show()

void CBalloonQueue::Show ( Info info)
private

Definition at line 617 of file syspager.cpp.

618{
619 TRACE("ShowBalloonTip called for flags=%x text=%ws; title=%ws\n", info.uIcon, info.szInfo, info.szInfoTitle);
620
621 // TODO: NIF_REALTIME, NIIF_NOSOUND, other Vista+ flags
622
623 m_current = info.pSource;
624 RECT rc;
625 m_toolbar->GetItemRect(IndexOf(m_current), &rc);
627 const WORD x = (rc.left + rc.right) / 2;
628 const WORD y = (rc.top + rc.bottom) / 2;
629
630 m_tooltips->SetTitle(info.szInfoTitle, info.uIcon);
633 m_tooltips->UpdateTipText(m_hwndParent, reinterpret_cast<LPARAM>(m_toolbar->m_hWnd), info.szInfo);
635
636 int timeout = info.uTimeout;
639
641
642 m_toolbar->SendNotifyCallback(m_current, NIN_BALLOONSHOW);
643}
HWND m_hWnd
Definition: atlwin.h:273
BOOL ClientToScreen(LPPOINT lpPoint) const
Definition: atlwin.h:393
static const int MinTimeout
Definition: syspager.cpp:90
static const int MaxTimeout
Definition: syspager.cpp:91
int IndexOf(InternalIconData *pdata)
Definition: syspager.cpp:601
INT SetMaxTipWidth(IN OPTIONAL INT width=-1)
Definition: rosctrls.h:793
VOID UpdateTipText(IN HWND hwndToolOwner, IN UINT uId, IN PCWSTR szText, IN HINSTANCE hinstResourceOwner=NULL)
Definition: rosctrls.h:685
BOOL SetTitle(PCWSTR szTitleText, WPARAM icon=0)
Definition: rosctrls.h:710
VOID TrackActivate(IN HWND hwndToolOwner, IN UINT uId)
Definition: rosctrls.h:715
VOID TrackPosition(IN WORD x, IN WORD y)
Definition: rosctrls.h:728
unsigned short WORD
Definition: ntddk_ex.h:93
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
Definition: dhcpd.h:245
#define BALLOON_MAXWIDTH
Definition: syspager.cpp:24
LONG_PTR LPARAM
Definition: windef.h:208

Referenced by OnTimer(), and UpdateInfo().

◆ UpdateInfo()

void CBalloonQueue::UpdateInfo ( InternalIconData notifyItem)

Definition at line 554 of file syspager.cpp.

555{
556 size_t len = 0;
557 HRESULT hr = StringCchLength(notifyItem->szInfo, _countof(notifyItem->szInfo), &len);
558 if (SUCCEEDED(hr) && len > 0)
559 {
560 Info info(notifyItem);
561
562 // If m_current == notifyItem, we want to replace the previous balloon even if there is a queue.
563 if (m_current != notifyItem && (m_current != NULL || !m_queue.IsEmpty()))
564 {
565 m_queue.AddTail(info);
566 }
567 else
568 {
569 Show(info);
570 }
571 }
572 else
573 {
574 Close(notifyItem, NIN_BALLOONHIDE);
575 }
576}
GLenum GLsizei len
Definition: glext.h:6722
#define SUCCEEDED(hr)
Definition: intsafe.h:50
HRESULT hr
Definition: shlfolder.c:183
#define _countof(array)
Definition: sndvol32.h:70
#define StringCchLength
Definition: strsafe.h:829
CHAR szInfo[256]
Definition: shellapi.h:240

Referenced by CNotifyToolbar::AddButton(), and CNotifyToolbar::UpdateButton().

Member Data Documentation

◆ BalloonsTimerId

const int CBalloonQueue::BalloonsTimerId = 1
static

Definition at line 89 of file syspager.cpp.

Referenced by SetTimer().

◆ CooldownBetweenBalloons

const int CBalloonQueue::CooldownBetweenBalloons = 2000
static

Definition at line 92 of file syspager.cpp.

Referenced by Close().

◆ m_current

InternalIconData* CBalloonQueue::m_current
private

Definition at line 123 of file syspager.cpp.

Referenced by Close(), CloseCurrent(), OnTimer(), Show(), and UpdateInfo().

◆ m_currentClosed

bool CBalloonQueue::m_currentClosed
private

Definition at line 124 of file syspager.cpp.

Referenced by Close(), and OnTimer().

◆ m_hwndParent

HWND CBalloonQueue::m_hwndParent
private

Definition at line 115 of file syspager.cpp.

Referenced by Deinit(), Init(), OnTimer(), SetTimer(), and Show().

◆ m_queue

CAtlList<Info> CBalloonQueue::m_queue
private

Definition at line 119 of file syspager.cpp.

Referenced by OnTimer(), RemoveInfo(), and UpdateInfo().

◆ m_timer

int CBalloonQueue::m_timer
private

Definition at line 126 of file syspager.cpp.

Referenced by Deinit(), OnTimer(), and SetTimer().

◆ m_toolbar

CNotifyToolbar* CBalloonQueue::m_toolbar
private

Definition at line 121 of file syspager.cpp.

Referenced by Close(), IndexOf(), Init(), and Show().

◆ m_tooltips

CTooltips* CBalloonQueue::m_tooltips
private

Definition at line 117 of file syspager.cpp.

Referenced by Close(), Init(), and Show().

◆ MaxTimeout

const int CBalloonQueue::MaxTimeout = 30000
static

Definition at line 91 of file syspager.cpp.

Referenced by Show().

◆ MinTimeout

const int CBalloonQueue::MinTimeout = 10000
static

Definition at line 90 of file syspager.cpp.

Referenced by Show().

◆ TimerInterval

const int CBalloonQueue::TimerInterval = 2000
static

Definition at line 88 of file syspager.cpp.


The documentation for this class was generated from the following file: