2007-06-22 04:15:17 +04:00
|
|
|
/*
|
|
|
|
* Copyright 2001-2003 Dr. Zoidberg Enterprises. All rights reserved.
|
|
|
|
* Copyright 2004-2007, Haiku Inc. All rights reserved.
|
|
|
|
*
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
2004-09-21 02:31:50 +04:00
|
|
|
#ifndef ZOIDBERG_STATUS_WINDOW_H
|
|
|
|
#define ZOIDBERG_STATUS_WINDOW_H
|
|
|
|
|
|
|
|
|
2007-06-22 04:15:17 +04:00
|
|
|
#include <Alert.h>
|
2004-09-21 02:31:50 +04:00
|
|
|
#include <Box.h>
|
|
|
|
#include <List.h>
|
2007-06-22 04:15:17 +04:00
|
|
|
#include <Node.h>
|
|
|
|
#include <Window.h>
|
2004-09-21 02:31:50 +04:00
|
|
|
|
|
|
|
class BStatusBar;
|
|
|
|
class BStringView;
|
|
|
|
class BMailStatusView;
|
|
|
|
|
|
|
|
class BMailStatusWindow : public BWindow {
|
|
|
|
public:
|
2007-06-22 04:15:17 +04:00
|
|
|
BMailStatusWindow(BRect rect, const char *name, uint32 showMode);
|
2004-09-21 02:31:50 +04:00
|
|
|
~BMailStatusWindow();
|
|
|
|
|
|
|
|
virtual void FrameMoved(BPoint origin);
|
|
|
|
virtual void WorkspaceActivated(int32 workspace, bool active);
|
|
|
|
virtual void MessageReceived(BMessage *msg);
|
|
|
|
|
|
|
|
BMailStatusView *NewStatusView(const char *description, bool upstream);
|
|
|
|
void RemoveView(BMailStatusView *view);
|
|
|
|
int32 CountVisibleItems();
|
|
|
|
|
|
|
|
bool HasItems(void);
|
|
|
|
void SetShowCriterion(uint32);
|
|
|
|
void SetDefaultMessage(const BString &message);
|
|
|
|
|
|
|
|
private:
|
|
|
|
friend class BMailStatusView;
|
|
|
|
|
2007-06-22 04:15:17 +04:00
|
|
|
void _CheckChains();
|
2004-09-21 02:31:50 +04:00
|
|
|
void SetBorderStyle(int32 look);
|
|
|
|
void ActuallyAddStatusView(BMailStatusView *status);
|
|
|
|
|
2007-06-22 04:15:17 +04:00
|
|
|
node_ref fChainDirectory;
|
|
|
|
BButton* fCheckNowButton;
|
2004-09-21 02:31:50 +04:00
|
|
|
BList fStatusViews;
|
|
|
|
uint32 fShowMode;
|
|
|
|
BView *fDefaultView;
|
|
|
|
BStringView *fMessageView;
|
|
|
|
float fMinWidth;
|
|
|
|
float fMinHeight;
|
|
|
|
int32 fWindowMoved;
|
|
|
|
int32 fLastWorkspace;
|
|
|
|
BRect fFrame;
|
2007-06-22 04:15:17 +04:00
|
|
|
|
2004-09-21 02:31:50 +04:00
|
|
|
uint32 _reserved[5];
|
|
|
|
};
|
|
|
|
|
|
|
|
class BMailStatusView : public BBox {
|
|
|
|
public:
|
|
|
|
void AddProgress(int32 how_much);
|
|
|
|
void SetMessage(const char *msg);
|
|
|
|
void SetMaximum(int32 max_bytes);
|
|
|
|
int32 CountTotalItems();
|
|
|
|
void SetTotalItems(int32 items);
|
|
|
|
void AddItem(void);
|
|
|
|
void Reset(bool hide = true);
|
|
|
|
|
|
|
|
virtual ~BMailStatusView();
|
|
|
|
|
|
|
|
private:
|
|
|
|
friend class BMailStatusWindow;
|
|
|
|
|
|
|
|
BMailStatusView(BRect rect,const char *description,bool upstream);
|
|
|
|
void AddSelfToWindow();
|
|
|
|
|
|
|
|
BStatusBar *status;
|
|
|
|
BMailStatusWindow *window;
|
|
|
|
int32 items_now;
|
|
|
|
int32 total_items;
|
|
|
|
bool is_upstream;
|
|
|
|
bool by_bytes;
|
|
|
|
char pre_text[255];
|
|
|
|
|
|
|
|
uint32 _reserved[5];
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* ZOIDBERG_STATUS_WINDOW_H */
|