PageRenderTime 11ms CodeModel.GetById 2ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/newview/llpanelmarketplaceinboxinventory.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 121 lines | 62 code | 32 blank | 27 comment | 0 complexity | 7ea0a24fb543b1abee797166def11c5a MD5 | raw file
  1/** 
  2 * @file llpanelmarketplaceinboxinventory.h
  3 * @brief LLInboxInventoryPanel class declaration
  4 *
  5 * $LicenseInfo:firstyear=2009&license=viewerlgpl$
  6 * Second Life Viewer Source Code
  7 * Copyright (C) 2010, Linden Research, Inc.
  8 * 
  9 * This library is free software; you can redistribute it and/or
 10 * modify it under the terms of the GNU Lesser General Public
 11 * License as published by the Free Software Foundation;
 12 * version 2.1 of the License only.
 13 * 
 14 * This library is distributed in the hope that it will be useful,
 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 17 * Lesser General Public License for more details.
 18 * 
 19 * You should have received a copy of the GNU Lesser General Public
 20 * License along with this library; if not, write to the Free Software
 21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 22 * 
 23 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
 24 * $/LicenseInfo$
 25 */
 26
 27#ifndef LL_INBOXINVENTORYPANEL_H
 28#define LL_INBOXINVENTORYPANEL_H
 29
 30
 31#include "llbadgeowner.h"
 32#include "llinventorypanel.h"
 33#include "llfolderviewitem.h"
 34
 35
 36#define SUPPORTING_FRESH_ITEM_COUNT	1
 37
 38
 39
 40class LLInboxInventoryPanel : public LLInventoryPanel
 41{
 42public:
 43	struct Params : public LLInitParam::Block<Params, LLInventoryPanel::Params>
 44	{};
 45	
 46	LLInboxInventoryPanel(const Params& p);
 47	~LLInboxInventoryPanel();
 48
 49	// virtual
 50	void buildFolderView(const LLInventoryPanel::Params& params);
 51
 52	// virtual
 53	LLFolderViewFolder * createFolderViewFolder(LLInvFVBridge * bridge);
 54	LLFolderViewItem * createFolderViewItem(LLInvFVBridge * bridge);
 55};
 56
 57
 58class LLInboxFolderViewFolder : public LLFolderViewFolder, public LLBadgeOwner
 59{
 60public:
 61	struct Params : public LLInitParam::Block<Params, LLFolderViewFolder::Params>
 62	{
 63		Optional<LLBadge::Params>	new_badge;
 64		
 65		Params()
 66		: new_badge("new_badge")
 67		{
 68		}
 69	};
 70	
 71	LLInboxFolderViewFolder(const Params& p);
 72	
 73	void draw();
 74	
 75	void selectItem();
 76	void toggleOpen();
 77
 78	void computeFreshness();
 79	void deFreshify();
 80
 81	bool isFresh() const { return mFresh; }
 82	
 83protected:
 84	void setCreationDate(time_t creation_date_utc);
 85
 86	bool mFresh;
 87};
 88
 89
 90class LLInboxFolderViewItem : public LLFolderViewItem, public LLBadgeOwner
 91{
 92public:
 93	struct Params : public LLInitParam::Block<Params, LLFolderViewItem::Params>
 94	{
 95		Optional<LLBadge::Params>	new_badge;
 96
 97		Params()
 98			: new_badge("new_badge")
 99		{
100		}
101	};
102
103	LLInboxFolderViewItem(const Params& p);
104
105	BOOL addToFolder(LLFolderViewFolder* folder, LLFolderView* root);
106	BOOL handleDoubleClick(S32 x, S32 y, MASK mask);
107
108	void draw();
109
110	void selectItem();
111
112	void computeFreshness();
113	void deFreshify();
114
115	bool isFresh() const { return mFresh; }
116
117protected:
118	bool mFresh;
119};
120
121#endif //LL_INBOXINVENTORYPANEL_H