ReactOS 0.4.17-dev-870-gcf89458
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
 
int m_timer
 

Detailed Description

Definition at line 90 of file syspager.cpp.

Constructor & Destructor Documentation

◆ CBalloonQueue()

CBalloonQueue::CBalloonQueue ( )

Definition at line 510 of file syspager.cpp.

510 :
515 m_timer(-1)
516{
517}
HWND m_hwndParent
Definition: syspager.cpp:120
CTooltips * m_tooltips
Definition: syspager.cpp:122
CNotifyToolbar * m_toolbar
Definition: syspager.cpp:126
InternalIconData * m_current
Definition: syspager.cpp:128
#define NULL
Definition: types.h:112

Member Function Documentation

◆ Close()

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

Definition at line 648 of file syspager.cpp.

649{
650 TRACE("HideBalloonTip called\n");
651
652 if (m_current == notifyItem)
653 {
655
656 m_current = NULL; // Prevent re-entry (TrackDeactivate will generate a TTN_POP)
659 }
660}
static const int CooldownBetweenBalloons
Definition: syspager.cpp:97
void SetTimer(int length)
Definition: syspager.cpp:615
bool SendNotifyCallback(InternalIconData *notifyItem, UINT uMsg)
Definition: syspager.cpp:1108
VOID TrackDeactivate()
Definition: rosctrls.h:728
#define TRACE(s)
Definition: solgame.cpp:4

◆ CloseCurrent()

void CBalloonQueue::CloseCurrent ( )

Definition at line 596 of file syspager.cpp.

597{
598 if (m_current != NULL)
599 {
600 Close(m_current, NIN_BALLOONTIMEOUT);
601 }
602}
@ Close
Definition: sacdrv.h:268

Referenced by CSysPagerWnd::OnBalloonPop().

◆ Deinit()

void CBalloonQueue::Deinit ( )

Definition at line 526 of file syspager.cpp.

527{
528 if (m_timer >= 0)
529 {
531 }
532}
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)

Referenced by CSysPagerWnd::OnDestroy().

◆ IndexOf()

int CBalloonQueue::IndexOf ( InternalIconData pdata)
private

Definition at line 604 of file syspager.cpp.

605{
606 int count = m_toolbar->GetButtonCount();
607 for (int i = 0; i < count; i++)
608 {
609 if (m_toolbar->GetItemData(i) == pdata)
610 return i;
611 }
612 return -1;
613}
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:163

Referenced by Show().

◆ Init()

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

Definition at line 519 of file syspager.cpp.

520{
522 m_toolbar = toolbar;
523 m_tooltips = balloons;
524}
static HWND hwndParent
Definition: cryptui.c:299

Referenced by CSysPagerWnd::OnCreate().

◆ OnTimer()

bool CBalloonQueue::OnTimer ( int  timerId)

Definition at line 534 of file syspager.cpp.

535{
536 if (timerId != m_timer)
537 return false;
538
540 m_timer = -1;
541
542 if (m_current)
543 {
544 Close(m_current, NIN_BALLOONTIMEOUT);
545 }
546 else
547 {
548 if (!m_queue.IsEmpty())
549 {
550 Info info = m_queue.RemoveHead();
551 Show(info);
552 }
553 }
554
555 return true;
556}
CAtlList< Info > m_queue
Definition: syspager.cpp:124
void Show(Info &info)
Definition: syspager.cpp:620
_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 580 of file syspager.cpp.

581{
582 Close(notifyItem, NIN_BALLOONHIDE);
583
584 for (POSITION next = m_queue.GetHeadPosition(); next;)
585 {
587 Info& info = m_queue.GetNext(next); // Note: This will advance the position
588 if (info.pSource == notifyItem)
589 {
590 m_queue.RemoveAt(current);
591 break;
592 }
593 }
594}
struct task_struct * current
Definition: linux.c:32
static unsigned __int64 next
Definition: rand_nt.c:6

Referenced by CNotifyToolbar::RemoveButton().

◆ SetTimer()

void CBalloonQueue::SetTimer ( int  length)
private

Definition at line 615 of file syspager.cpp.

616{
618}
static const int BalloonsTimerId
Definition: syspager.cpp:94
GLuint GLsizei GLsizei * length
Definition: glext.h:6040

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

◆ Show()

void CBalloonQueue::Show ( Info info)
private

Definition at line 620 of file syspager.cpp.

621{
622 TRACE("ShowBalloonTip called for flags=%x text=%ws; title=%ws\n", info.uIcon, info.szInfo, info.szInfoTitle);
623
624 // TODO: NIF_REALTIME, NIIF_NOSOUND, other Vista+ flags
625
626 m_current = info.pSource;
627 RECT rc;
628 m_toolbar->GetItemRect(IndexOf(m_current), &rc);
629 UINT halfsize = (rc.right - rc.left) / 2;
631 WORD x = rc.left + halfsize, y = rc.top + halfsize;
632
633 m_tooltips->SetTitle(info.szInfoTitle, info.uIcon);
636 m_tooltips->UpdateTipText(m_hwndParent, reinterpret_cast<LPARAM>(m_toolbar->m_hWnd), info.szInfo);
638
639 int timeout = info.uTimeout;
642
644
645 m_toolbar->SendNotifyCallback(m_current, NIN_BALLOONSHOW);
646}
HWND m_hWnd
Definition: atlwin.h:273
BOOL ClientToScreen(LPPOINT lpPoint) const
Definition: atlwin.h:393
static const int MinTimeout
Definition: syspager.cpp:95
static const int MaxTimeout
Definition: syspager.cpp:96
int IndexOf(InternalIconData *pdata)
Definition: syspager.cpp:604
INT SetMaxTipWidth(IN OPTIONAL INT width=-1)
Definition: rosctrls.h:798
VOID UpdateTipText(IN HWND hwndToolOwner, IN UINT uId, IN PCWSTR szText, IN HINSTANCE hinstResourceOwner=NULL)
Definition: rosctrls.h:690
BOOL SetTitle(PCWSTR szTitleText, WPARAM icon=0)
Definition: rosctrls.h:715
VOID TrackActivate(IN HWND hwndToolOwner, IN UINT uId)
Definition: rosctrls.h:720
VOID TrackPosition(IN WORD x, IN WORD y)
Definition: rosctrls.h:733
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
unsigned int UINT
Definition: sysinfo.c:13
LONG_PTR LPARAM
Definition: minwindef.h:175
LONG right
Definition: windef.h:108
LONG top
Definition: windef.h:107
LONG left
Definition: windef.h:106
Definition: dhcpd.h:248
#define BALLOON_MAXWIDTH
Definition: syspager.cpp:24

Referenced by OnTimer(), and UpdateInfo().

◆ UpdateInfo()

void CBalloonQueue::UpdateInfo ( InternalIconData notifyItem)

Definition at line 558 of file syspager.cpp.

559{
560 if (notifyItem->szInfo[0])
561 {
562 Info info(notifyItem);
563
564 // If m_current == notifyItem, we want to replace the previous balloon even if there is a queue.
565 if (m_current != notifyItem && (m_current != NULL || !m_queue.IsEmpty()))
566 {
567 m_queue.AddTail(info);
568 }
569 else
570 {
571 Show(info);
572 }
573 }
574 else
575 {
576 Close(notifyItem, NIN_BALLOONHIDE);
577 }
578}
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 94 of file syspager.cpp.

Referenced by SetTimer().

◆ CooldownBetweenBalloons

const int CBalloonQueue::CooldownBetweenBalloons = 2000
static

Definition at line 97 of file syspager.cpp.

Referenced by Close().

◆ m_current

InternalIconData* CBalloonQueue::m_current
private

Definition at line 128 of file syspager.cpp.

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

◆ m_hwndParent

HWND CBalloonQueue::m_hwndParent
private

Definition at line 120 of file syspager.cpp.

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

◆ m_queue

CAtlList<Info> CBalloonQueue::m_queue
private

Definition at line 124 of file syspager.cpp.

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

◆ m_timer

int CBalloonQueue::m_timer
private

Definition at line 130 of file syspager.cpp.

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

◆ m_toolbar

CNotifyToolbar* CBalloonQueue::m_toolbar
private

Definition at line 126 of file syspager.cpp.

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

◆ m_tooltips

CTooltips* CBalloonQueue::m_tooltips
private

Definition at line 122 of file syspager.cpp.

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

◆ MaxTimeout

const int CBalloonQueue::MaxTimeout = 30000
static

Definition at line 96 of file syspager.cpp.

Referenced by Show().

◆ MinTimeout

const int CBalloonQueue::MinTimeout = 10000
static

Definition at line 95 of file syspager.cpp.

Referenced by Show().

◆ TimerInterval

const int CBalloonQueue::TimerInterval = 2000
static

Definition at line 93 of file syspager.cpp.


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