#ifndef SWITCHER_H
#define SWITCHER_H
#include <Box.h>
#include <List.h>
#include <OS.h>
#include <StringView.h>
#include <Window.h>
class TTeamGroup;
class TIconView;
class TBox;
class TWindowView;
class TSwitcherWindow;
struct client_window_info;
class TSwitchManager : public BHandler {
public:
TSwitchManager();
virtual ~TSwitchManager();
virtual void MessageReceived(BMessage* message);
void Stop(bool doAction, uint32 modifiers);
void Unblock();
int32 CurrentIndex();
int32 CurrentWindow();
int32 CurrentSlot();
BList* GroupList();
void QuitApp();
void HideApp();
void CycleApp(bool forward, bool activate = false);
void CycleWindow(bool forward, bool wrap = true);
void SwitchToApp(int32 prevIndex, int32 newIndex,
bool forward);
client_window_info* WindowInfo(int32 groupIndex, int32 windowIndex);
int32 CountWindows(int32 groupIndex,
bool inCurrentWorkspace = false);
TTeamGroup* FindTeam(team_id, int32* index);
int32 LargeIconSize() { return fLargeIconSize; }
int32 SmallIconSize() { return fSmallIconSize; }
int32 SlotSize() { return fSlotSize; }
int32 ScrollStep() { return fScrollStep; }
int32 SlotCount() { return fSlotCount; }
int32 CenterSlot() { return fCenterSlot; }
BRect CenterRect();
private:
void MainEntry(BMessage* message);
void Process(bool forward, bool byWindow = false);
void QuickSwitch(BMessage* message);
void SwitchWindow(team_id team, bool forward,
bool activate);
bool ActivateApp(bool forceShow,
bool allowWorkspaceSwitch);
void ActivateWindow(int32 windowID = -1);
void _SortApps();
bool _FindNextValidApp(bool forward);
TSwitcherWindow* fWindow;
sem_id fMainMonitor;
bool fBlock;
bigtime_t fSkipUntil;
bigtime_t fLastSwitch;
int32 fQuickSwitchIndex;
int32 fQuickSwitchWindow;
BList fGroupList;
int32 fCurrentIndex;
int32 fCurrentWindow;
int32 fCurrentSlot;
int32 fWindowID;
int32 fLargeIconSize;
int32 fSmallIconSize;
int32 fSlotSize;
int32 fScrollStep;
int32 fSlotCount;
int32 fCenterSlot;
};
#endif