1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-11 23:54:18 +00:00
JUCE/extras/Introjucer/Source/Project/jucer_ProjectContentComponent.h
2013-06-13 14:06:55 +01:00

123 lines
4.3 KiB
C++

/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2013 - Raw Material Software Ltd.
Permission is granted to use this software under the terms of either:
a) the GPL v2 (or any later version)
b) the Affero GPL v3
Details of these licenses can be found at: www.gnu.org/licenses
JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
------------------------------------------------------------------------------
To release a closed-source product which uses JUCE, commercial licenses are
available: visit www.juce.com for more information.
==============================================================================
*/
#ifndef __JUCER_PROJECTCONTENTCOMPONENT_JUCEHEADER__
#define __JUCER_PROJECTCONTENTCOMPONENT_JUCEHEADER__
#include "jucer_Project.h"
#include "../Application/jucer_OpenDocumentManager.h"
class ProjectTreeViewBase;
//==============================================================================
/**
*/
class ProjectContentComponent : public Component,
public ApplicationCommandTarget,
private ChangeListener,
private OpenDocumentManager::DocumentCloseListener
{
public:
//==============================================================================
ProjectContentComponent();
~ProjectContentComponent();
Project* getProject() const noexcept { return project; }
virtual void setProject (Project* project);
void saveTreeViewState();
void saveOpenDocumentList();
void reloadLastOpenDocuments();
bool showEditorForFile (const File& f, bool grabFocus);
File getCurrentFile() const;
bool showDocument (OpenDocumentManager::Document* doc, bool grabFocus);
void hideDocument (OpenDocumentManager::Document* doc);
OpenDocumentManager::Document* getCurrentDocument() const { return currentDocument; }
void closeDocument();
void saveDocument();
void saveAs();
void hideEditor();
bool setEditorComponent (Component* editor, OpenDocumentManager::Document* doc);
Component* getEditorComponent() const { return contentView; }
bool goToPreviousFile();
bool goToNextFile();
bool canGoToCounterpart() const;
bool goToCounterpart();
bool saveProject();
void closeProject();
void openInIDE();
void deleteSelectedTreeItems();
void updateMainWindowTitle();
void updateMissingFileStatuses();
virtual void createProjectTabs();
virtual void deleteProjectTabs();
void rebuildProjectTabs();
void showBubbleMessage (const Rectangle<int>& pos, const String& text);
//==============================================================================
ApplicationCommandTarget* getNextCommandTarget();
void getAllCommands (Array <CommandID>& commands);
void getCommandInfo (CommandID commandID, ApplicationCommandInfo& result);
bool isCommandActive (const CommandID commandID);
bool perform (const InvocationInfo& info);
void paint (Graphics&);
void paintOverChildren (Graphics&);
void resized();
void childBoundsChanged (Component* child);
void lookAndFeelChanged();
protected:
Project* project;
OpenDocumentManager::Document* currentDocument;
RecentDocumentList recentDocumentList;
ScopedPointer<Component> logo;
ScopedPointer<Component> translationTool;
TabbedComponent treeViewTabs;
ScopedPointer<ResizableEdgeComponent> resizerBar;
ScopedPointer<Component> contentView;
ComponentBoundsConstrainer treeSizeConstrainer;
BubbleMessageComponent bubbleMessage;
void documentAboutToClose (OpenDocumentManager::Document*);
void changeListenerCallback (ChangeBroadcaster*);
TreeView* getFilesTreeView() const;
ProjectTreeViewBase* getFilesTreeRoot() const;
void showTranslationTool();
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ProjectContentComponent)
};
#endif // __JUCER_PROJECTCONTENTCOMPONENT_JUCEHEADER__