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*/
35f11e0f20SJohn Scipione#ifndef WINDOW_MENU_ITEM_H
36f11e0f20SJohn Scipione#define WINDOW_MENU_ITEM_H
3741281cf3SAxel Dörfler
381c7348a7SAxel Dörfler
39c9363f78SJohn Scipione#include "TruncatableMenuItem.h"
40c9363f78SJohn Scipione
4141281cf3SAxel Dörfler#include <String.h>
4241281cf3SAxel Dörfler
4341281cf3SAxel Dörfler
4441281cf3SAxel Dörflerclass BBitmap;
4541281cf3SAxel Dörfler
461cd61330SJohn Scipione// Individual windows of an application item for WindowMenu,
471cd61330SJohn Scipione// sub of TeamMenuItem all DB positions
48c9363f78SJohn Scipioneclass TWindowMenuItem : public TTruncatableMenuItem {
491c7348a7SAxel Dörflerpublic:
50c38afcd6SJohn Scipione								TWindowMenuItem(const char* name, int32 id,
511c7348a7SAxel Dörfler									bool mini, bool currentWorkSpace,
521c7348a7SAxel Dörfler									bool dragging = false);
531c7348a7SAxel Dörfler
54c38afcd6SJohn Scipione			void				SetTo(const char* name, int32 id, bool mini,
551c7348a7SAxel Dörfler									bool currentWorkSpace,
561c7348a7SAxel Dörfler									bool dragging = false);
575e625eadSJohn Scipione
58c9363f78SJohn Scipione			bool				Expanded() const { return fExpanded; };
595e625eadSJohn Scipione			void				SetExpanded(bool expand) { fExpanded = expand; };
601c7348a7SAxel Dörfler
61c9363f78SJohn Scipione			int32				ID() const { return fID; };
62c9363f78SJohn Scipione			bool				Modified() const { return fModified; };
635e625eadSJohn Scipione
64c9363f78SJohn Scipione			bool				RequiresUpdate() { return fRequireUpdate; };
65c9363f78SJohn Scipione			void				SetRequireUpdate(bool update)
66c9363f78SJohn Scipione									{ fRequireUpdate = update; };
671c7348a7SAxel Dörfler
681c7348a7SAxel Dörfler	static	int32				InsertIndexFor(BMenu* menu, int32 startIndex,
691c7348a7SAxel Dörfler									TWindowMenuItem* item);
701c7348a7SAxel Dörfler
711c7348a7SAxel Dörflerprotected:
721687edd0SFredrik Holmqvist	virtual void				GetContentSize(float* width, float* height);
731c7348a7SAxel Dörfler	virtual void				DrawContent();
741c7348a7SAxel Dörfler	virtual status_t			Invoke(BMessage* message = NULL);
751c7348a7SAxel Dörfler	virtual void				Draw();
761c7348a7SAxel Dörfler
771c7348a7SAxel Dörflerprivate:
78c38afcd6SJohn Scipione			void				_Init(const char* name);
795e625eadSJohn Scipione
801c7348a7SAxel Dörfler			int32				fID;
811c7348a7SAxel Dörfler			bool				fMini;
821c7348a7SAxel Dörfler			bool				fCurrentWorkSpace;
831c7348a7SAxel Dörfler			const BBitmap*		fBitmap;
845e625eadSJohn Scipione			float				fLabelWidth;
855e625eadSJohn Scipione			float				fLabelAscent;
865e625eadSJohn Scipione			float				fLabelDescent;
871c7348a7SAxel Dörfler			bool				fDragging;
881c7348a7SAxel Dörfler			bool				fExpanded;
891c7348a7SAxel Dörfler			bool				fRequireUpdate;
901c7348a7SAxel Dörfler			bool				fModified;
9141281cf3SAxel Dörfler};
9241281cf3SAxel Dörfler
9341281cf3SAxel Dörfler
94f11e0f20SJohn Scipione#endif	// WINDOW_MENU_ITEM_H
95