2 ==============================================================================
4 This file is part of the JUCE library - "Jules' Utility Class Extensions"
5 Copyright 2004-10 by Raw Material Software Ltd.
7 ------------------------------------------------------------------------------
9 JUCE can be redistributed and/or modified under the terms of the GNU General
10 Public License (Version 2), as published by the Free Software Foundation.
11 A copy of the license is included in the JUCE distribution, or can be found
12 online at www.gnu.org/licenses.
14 JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
15 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16 A PARTICULAR PURPOSE. See the GNU General Public License for more details.
18 ------------------------------------------------------------------------------
20 To release a closed-source product which uses JUCE, commercial licenses are
21 available: visit www.rawmaterialsoftware.com/juce for more information.
23 ==============================================================================
26 #ifndef __JUCER_MAINWINDOW_JUCEHEADER__
27 #define __JUCER_MAINWINDOW_JUCEHEADER__
29 #include "../Project/jucer_ProjectContentComponent.h"
32 //==============================================================================
34 The big top-level window where everything happens.
36 class MainWindow
: public DocumentWindow
,
37 public ApplicationCommandTarget
,
38 public FileDragAndDropTarget
,
39 public DragAndDropContainer
42 //==============================================================================
46 //==============================================================================
47 void closeButtonPressed();
49 //==============================================================================
50 bool canOpenFile (const File
& file
) const;
51 bool openFile (const File
& file
);
52 void setProject (Project
* newProject
);
53 Project
* getProject() const { return currentProject
; }
55 void restoreWindowPosition();
56 bool closeProject (Project
* project
);
57 bool closeCurrentProject();
59 bool isInterestedInFileDrag (const StringArray
& files
);
60 void filesDropped (const StringArray
& filenames
, int mouseX
, int mouseY
);
62 void activeWindowStatusChanged();
64 void updateTitle (const String
& documentName
);
66 ProjectContentComponent
* getProjectContentComponent() const;
68 //==============================================================================
69 ApplicationCommandTarget
* getNextCommandTarget();
70 void getAllCommands (Array
<CommandID
>& commands
);
71 void getCommandInfo (CommandID commandID
, ApplicationCommandInfo
& result
);
72 bool perform (const InvocationInfo
& info
);
75 ScopedPointer
<Project
> currentProject
;
77 const String
getProjectWindowPosName() const
79 jassert (currentProject
!= nullptr);
80 if (currentProject
== nullptr)
83 return "projectWindowPos_" + currentProject
->getProjectUID();
86 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainWindow
);
90 #endif // __JUCER_MAINWINDOW_JUCEHEADER__