141281cf3SAxel Dörfler/*
241281cf3SAxel DörflerOpen Tracker License
341281cf3SAxel Dörfler
441281cf3SAxel DörflerTerms and Conditions
541281cf3SAxel Dörfler
641281cf3SAxel DörflerCopyright (c) 1991-2000, Be Incorporated. All rights reserved.
741281cf3SAxel Dörfler
841281cf3SAxel DörflerPermission is hereby granted, free of charge, to any person obtaining a copy of
941281cf3SAxel Dörflerthis software and associated documentation files (the "Software"), to deal in
1041281cf3SAxel Dörflerthe Software without restriction, including without limitation the rights to
1141281cf3SAxel Dörfleruse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
1241281cf3SAxel Dörflerof the Software, and to permit persons to whom the Software is furnished to do
1341281cf3SAxel Dörflerso, subject to the following conditions:
1441281cf3SAxel Dörfler
1541281cf3SAxel DörflerThe above copyright notice and this permission notice applies to all licensees
1641281cf3SAxel Dörflerand shall be included in all copies or substantial portions of the Software.
1741281cf3SAxel Dörfler
1841281cf3SAxel DörflerTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1941281cf3SAxel DörflerIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF TITLE, MERCHANTABILITY,
2041281cf3SAxel DörflerFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
2141281cf3SAxel DörflerBE INCORPORATED BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
2241281cf3SAxel DörflerAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION
2341281cf3SAxel DörflerWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2441281cf3SAxel Dörfler
2541281cf3SAxel DörflerExcept as contained in this notice, the name of Be Incorporated shall not be
2641281cf3SAxel Dörflerused in advertising or otherwise to promote the sale, use or other dealings in
2741281cf3SAxel Dörflerthis Software without prior written authorization from Be Incorporated.
2841281cf3SAxel Dörfler
291687edd0SFredrik HolmqvistTracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
301687edd0SFredrik Holmqvisttrademarks of Be Incorporated in the United States and other countries. Other
311687edd0SFredrik Holmqvistbrand product names are registered trademarks or trademarks of their respective
321687edd0SFredrik Holmqvistholders.
3341281cf3SAxel DörflerAll rights reserved.
3441281cf3SAxel Dörfler*/
359f339a00SJohn Scipione#ifndef TEAM_MENU_ITEM_H
369f339a00SJohn Scipione#define TEAM_MENU_ITEM_H
3741281cf3SAxel Dörfler
381cd61330SJohn Scipione
3941281cf3SAxel Dörfler//	Individual team/application listing
4041281cf3SAxel Dörfler//	item for TeamMenu in mini/vertical mode
411cd61330SJohn Scipione//	item for ExpandoMenuBar in vertical or horizontal expanded mode
421cd61330SJohn Scipione
4341281cf3SAxel Dörfler
44c9363f78SJohn Scipione#include "TruncatableMenuItem.h"
4541281cf3SAxel Dörfler
4641281cf3SAxel Dörfler
4741281cf3SAxel Dörflerclass BBitmap;
48c9363f78SJohn Scipioneclass TBarView;
49c9363f78SJohn Scipioneclass TWindowMenuItem;
5041281cf3SAxel Dörfler
51c9363f78SJohn Scipioneclass TTeamMenuItem : public TTruncatableMenuItem {
525b0fd10dSJohn Scipionepublic:
535b0fd10dSJohn Scipione								TTeamMenuItem(BList* team, BBitmap* icon,
545af340efSJohn Scipione									char* name, char* signature,
5518bcf77aSJohn Scipione									float width = -1.0f, float height = -1.0f);
565b0fd10dSJohn Scipione								TTeamMenuItem(float width = -1.0f,
5718bcf77aSJohn Scipione									float height = -1.0f);
585b0fd10dSJohn Scipione	virtual						~TTeamMenuItem();
595b0fd10dSJohn Scipione
605e625eadSJohn Scipione			status_t			Invoke(BMessage* message = NULL);
615b0fd10dSJohn Scipione
62c9d2a320SJohn Scipione			void				SetOverrideWidth(float width)
63c9d2a320SJohn Scipione									{ fOverrideWidth = width; };
64c9d2a320SJohn Scipione			void				SetOverrideHeight(float height)
65c9d2a320SJohn Scipione									{ fOverrideHeight = height; };
665b0fd10dSJohn Scipione			void				SetOverrideSelected(bool selected);
675b0fd10dSJohn Scipione
68c9d2a320SJohn Scipione			int32				ArrowDirection() const
69c9d2a320SJohn Scipione									{ return fArrowDirection; };
70c9d2a320SJohn Scipione			void				SetArrowDirection(int32 direction)
71c9d2a320SJohn Scipione									{ fArrowDirection = direction; };
721dccb7aaSJohn Scipione
73c9d2a320SJohn Scipione			BBitmap*			Icon() const { return fIcon; };
74c9d2a320SJohn Scipione			void				SetIcon(BBitmap* icon);
755b0fd10dSJohn Scipione
761dccb7aaSJohn Scipione			bool				IsExpanded() const { return fExpanded; };
775b0fd10dSJohn Scipione			void				ToggleExpandState(bool resizeWindow);
786b65d934SJohn Scipione
795b0fd10dSJohn Scipione			BRect				ExpanderBounds() const;
805b0fd10dSJohn Scipione			TWindowMenuItem*	ExpandedWindowItem(int32 id);
815b0fd10dSJohn Scipione
821dccb7aaSJohn Scipione			float				LabelWidth() const { return fLabelWidth; };
831dccb7aaSJohn Scipione			BList*				Teams() const { return fTeam; };
84c9363f78SJohn Scipione			const char*			Signature() const { return fSignature; };
855b0fd10dSJohn Scipione
865b0fd10dSJohn Scipioneprotected:
875b0fd10dSJohn Scipione			void				GetContentSize(float* width, float* height);
885b0fd10dSJohn Scipione			void				Draw();
895b0fd10dSJohn Scipione			void				DrawContent();
901dccb7aaSJohn Scipione			void				DrawExpanderArrow();
915b0fd10dSJohn Scipione
925b0fd10dSJohn Scipioneprivate:
93e9982f68SJohn Scipione			void				_Init(BList* team, BBitmap* icon,
94c9363f78SJohn Scipione									char* name, char* signature,
9518bcf77aSJohn Scipione									float width = -1.0f, float height = -1.0f);
965b0fd10dSJohn Scipione
975b0fd10dSJohn Scipione			bool				_IsSelected() const;
985b0fd10dSJohn Scipione
995b0fd10dSJohn Scipioneprivate:
1005b0fd10dSJohn Scipione			BList*				fTeam;
1015b0fd10dSJohn Scipione			BBitmap*			fIcon;
102c9363f78SJohn Scipione			char*				fSignature;
1036b65d934SJohn Scipione
1045b0fd10dSJohn Scipione			float				fOverrideWidth;
1055b0fd10dSJohn Scipione			float				fOverrideHeight;
1065b0fd10dSJohn Scipione
1071dccb7aaSJohn Scipione			TBarView*			fBarView;
1081dccb7aaSJohn Scipione			float				fLabelWidth;
1091dccb7aaSJohn Scipione			float				fLabelAscent;
1101dccb7aaSJohn Scipione			float				fLabelDescent;
1111dccb7aaSJohn Scipione
1125b0fd10dSJohn Scipione			bool				fOverriddenSelected;
1131dccb7aaSJohn Scipione
1141dccb7aaSJohn Scipione			bool				fExpanded;
1151dccb7aaSJohn Scipione			int32				fArrowDirection;
11641281cf3SAxel Dörfler};
11741281cf3SAxel Dörfler
11871bd3ba5SJonas Sundström
1199f339a00SJohn Scipione#endif	// TEAM_MENU_ITEM_H
120