PageRenderTime 33ms CodeModel.GetById 21ms app.highlight 9ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/newview/llviewermenufile.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 130 lines | 82 code | 23 blank | 25 comment | 0 complexity | e34faf3f025cb837b21dd81c29fb0c6b MD5 | raw file
  1/** 
  2 * @file llviewermenufile.h
  3 * @brief "File" menu in the main menu bar.
  4 *
  5 * $LicenseInfo:firstyear=2002&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 LLVIEWERMENUFILE_H
 28#define LLVIEWERMENUFILE_H
 29
 30#include "llfoldertype.h"
 31#include "llassetstorage.h"
 32#include "llinventorytype.h"
 33#include "llfilepicker.h"
 34
 35class LLTransactionID;
 36
 37
 38void init_menu_file();
 39
 40LLUUID upload_new_resource(
 41	const std::string& src_filename, 
 42	std::string name,
 43	std::string desc, 
 44	S32 compression_info,
 45	LLFolderType::EType destination_folder_type,
 46	LLInventoryType::EType inv_type,
 47	U32 next_owner_perms,
 48	U32 group_perms,
 49	U32 everyone_perms,
 50	const std::string& display_name,
 51	LLAssetStorage::LLStoreAssetCallback callback,
 52	S32 expected_upload_cost,
 53	void *userdata);
 54
 55void upload_new_resource(
 56	const LLTransactionID &tid, 
 57	LLAssetType::EType type,
 58	std::string name,
 59	std::string desc, 
 60	S32 compression_info,
 61	LLFolderType::EType destination_folder_type,
 62	LLInventoryType::EType inv_type,
 63	U32 next_owner_perms,
 64	U32 group_perms,
 65	U32 everyone_perms,
 66	const std::string& display_name,
 67	LLAssetStorage::LLStoreAssetCallback callback,
 68	S32 expected_upload_cost,
 69	void *userdata);
 70
 71
 72LLAssetID generate_asset_id_for_new_upload(const LLTransactionID& tid);
 73void increase_new_upload_stats(LLAssetType::EType asset_type);
 74void assign_defaults_and_show_upload_message(
 75	LLAssetType::EType asset_type,
 76	LLInventoryType::EType& inventory_type,
 77	std::string& name,
 78	const std::string& display_name,
 79	std::string& description);
 80
 81LLSD generate_new_resource_upload_capability_body(
 82	LLAssetType::EType asset_type,
 83	const std::string& name,
 84	const std::string& desc,
 85	LLFolderType::EType destination_folder_type,
 86	LLInventoryType::EType inv_type,
 87	U32 next_owner_perms,
 88	U32 group_perms,
 89	U32 everyone_perms);
 90
 91void on_new_single_inventory_upload_complete(
 92	LLAssetType::EType asset_type,
 93	LLInventoryType::EType inventory_type,
 94	const std::string inventory_type_string,
 95	const LLUUID& item_folder_id,
 96	const std::string& item_name,
 97	const std::string& item_description,
 98	const LLSD& server_response,
 99	S32 upload_price);
100
101class LLFilePickerThread : public LLThread
102{ //multi-threaded file picker (runs system specific file picker in background and calls "notify" from main thread)
103public:
104
105	static std::queue<LLFilePickerThread*> sDeadQ;
106	static LLMutex* sMutex;
107
108	static void initClass();
109	static void cleanupClass();
110	static void clearDead();
111
112	std::string mFile; 
113
114	LLFilePicker::ELoadFilter mFilter;
115
116	LLFilePickerThread(LLFilePicker::ELoadFilter filter)
117		: LLThread("file picker"), mFilter(filter)
118	{
119
120	}
121
122	void getFile();
123
124	virtual void run();
125
126	virtual void notify(const std::string& filename) = 0;
127};
128
129
130#endif