/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. #ifndef LLVIEWERMENUFILE_H
  27. #define LLVIEWERMENUFILE_H
  28. #include "llfoldertype.h"
  29. #include "llassetstorage.h"
  30. #include "llinventorytype.h"
  31. #include "llfilepicker.h"
  32. class LLTransactionID;
  33. void init_menu_file();
  34. LLUUID upload_new_resource(
  35. const std::string& src_filename,
  36. std::string name,
  37. std::string desc,
  38. S32 compression_info,
  39. LLFolderType::EType destination_folder_type,
  40. LLInventoryType::EType inv_type,
  41. U32 next_owner_perms,
  42. U32 group_perms,
  43. U32 everyone_perms,
  44. const std::string& display_name,
  45. LLAssetStorage::LLStoreAssetCallback callback,
  46. S32 expected_upload_cost,
  47. void *userdata);
  48. void upload_new_resource(
  49. const LLTransactionID &tid,
  50. LLAssetType::EType type,
  51. std::string name,
  52. std::string desc,
  53. S32 compression_info,
  54. LLFolderType::EType destination_folder_type,
  55. LLInventoryType::EType inv_type,
  56. U32 next_owner_perms,
  57. U32 group_perms,
  58. U32 everyone_perms,
  59. const std::string& display_name,
  60. LLAssetStorage::LLStoreAssetCallback callback,
  61. S32 expected_upload_cost,
  62. void *userdata);
  63. LLAssetID generate_asset_id_for_new_upload(const LLTransactionID& tid);
  64. void increase_new_upload_stats(LLAssetType::EType asset_type);
  65. void assign_defaults_and_show_upload_message(
  66. LLAssetType::EType asset_type,
  67. LLInventoryType::EType& inventory_type,
  68. std::string& name,
  69. const std::string& display_name,
  70. std::string& description);
  71. LLSD generate_new_resource_upload_capability_body(
  72. LLAssetType::EType asset_type,
  73. const std::string& name,
  74. const std::string& desc,
  75. LLFolderType::EType destination_folder_type,
  76. LLInventoryType::EType inv_type,
  77. U32 next_owner_perms,
  78. U32 group_perms,
  79. U32 everyone_perms);
  80. void on_new_single_inventory_upload_complete(
  81. LLAssetType::EType asset_type,
  82. LLInventoryType::EType inventory_type,
  83. const std::string inventory_type_string,
  84. const LLUUID& item_folder_id,
  85. const std::string& item_name,
  86. const std::string& item_description,
  87. const LLSD& server_response,
  88. S32 upload_price);
  89. class LLFilePickerThread : public LLThread
  90. { //multi-threaded file picker (runs system specific file picker in background and calls "notify" from main thread)
  91. public:
  92. static std::queue<LLFilePickerThread*> sDeadQ;
  93. static LLMutex* sMutex;
  94. static void initClass();
  95. static void cleanupClass();
  96. static void clearDead();
  97. std::string mFile;
  98. LLFilePicker::ELoadFilter mFilter;
  99. LLFilePickerThread(LLFilePicker::ELoadFilter filter)
  100. : LLThread("file picker"), mFilter(filter)
  101. {
  102. }
  103. void getFile();
  104. virtual void run();
  105. virtual void notify(const std::string& filename) = 0;
  106. };
  107. #endif