usb_ecm: Use the current configuration instead of a fixed one.
[haiku.git] / src / servers / app / stackandtile / SATWindow.h
blobbc506a9ab578170ecc7c5a302f787797a935913f
1 /*
2 * Copyright 2010-2014 Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * John Scipione, jscipione@gmail.com
7 * Clemens Zeidler, haiku@clemens-zeidler.de
8 */
9 #ifndef SAT_WINDOW_H
10 #define SAT_WINDOW_H
13 #include <Region.h>
15 #include "SATDecorator.h"
16 #include "SATGroup.h"
17 #include "Stacking.h"
18 #include "Tiling.h"
21 class Desktop;
22 class SATGroup;
23 class StackAndTile;
24 class Window;
27 class SATWindow {
28 public:
29 SATWindow(StackAndTile* sat, Window* window);
30 ~SATWindow();
32 Window* GetWindow() { return fWindow; }
33 SATDecorator* GetDecorator() const;
34 StackAndTile* GetStackAndTile() { return fStackAndTile; }
35 Desktop* GetDesktop() { return fDesktop; }
36 //! Can be NULL if memory allocation failed!
37 SATGroup* GetGroup();
38 WindowArea* GetWindowArea() { return fWindowArea; }
40 bool HandleMessage(SATWindow* sender,
41 BPrivate::LinkReceiver& link,
42 BPrivate::LinkSender& reply);
44 bool PropagateToGroup(SATGroup* group);
46 // hook function called from SATGroup
47 bool AddedToGroup(SATGroup* group, WindowArea* area);
48 bool RemovedFromGroup(SATGroup* group,
49 bool stayBelowMouse);
50 void RemovedFromArea(WindowArea* area);
51 void WindowLookChanged(window_look look);
53 bool StackWindow(SATWindow* child);
55 void FindSnappingCandidates();
56 bool JoinCandidates();
57 void DoGroupLayout();
59 void AdjustSizeLimits(BRect targetFrame);
60 void SetOriginalSizeLimits(int32 minWidth,
61 int32 maxWidth, int32 minHeight,
62 int32 maxHeight);
63 void GetSizeLimits(int32* minWidth, int32* maxWidth,
64 int32* minHeight, int32* maxHeight) const;
65 void AddDecorator(int32* minWidth, int32* maxWidth,
66 int32* minHeight, int32* maxHeight);
67 void AddDecorator(BRect& frame);
69 // hook called when window has been resized form the outside
70 void Resized();
71 bool IsHResizeable() const;
72 bool IsVResizeable() const;
74 //! \return the complete window frame including the Decorator
75 BRect CompleteWindowFrame();
77 //! \return true if window is in a group with a least another window
78 bool PositionManagedBySAT();
80 bool HighlightTab(bool active);
81 bool HighlightBorders(Decorator::Region region,
82 bool active);
83 bool IsTabHighlighted();
84 bool IsBordersHighlighted();
86 uint64 Id();
88 bool SetSettings(const BMessage& message);
89 void GetSettings(BMessage& message);
90 private:
91 uint64 _GenerateId();
93 void _UpdateSizeLimits();
94 void _RestoreOriginalSize(
95 bool stayBelowMouse = true);
97 Window* fWindow;
98 StackAndTile* fStackAndTile;
99 Desktop* fDesktop;
101 //! Current group.
102 WindowArea* fWindowArea;
104 SATSnappingBehaviour* fOngoingSnapping;
105 SATStacking fSATStacking;
106 SATTiling fSATTiling;
108 SATSnappingBehaviourList fSATSnappingBehaviourList;
110 int32 fOriginalMinWidth;
111 int32 fOriginalMaxWidth;
112 int32 fOriginalMinHeight;
113 int32 fOriginalMaxHeight;
115 float fOriginalWidth;
116 float fOriginalHeight;
118 uint64 fId;
120 float fOldTabLocatiom;
124 #endif