Document.h

Go to the documentation of this file.
00001 
00005 /* Copyright © 2009 James Legg.
00006     This program is free software: you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation, either version 3 of the License, or
00009     (at your option) any later version.
00010 */
00011 #ifndef DOCUMENT_H_
00012 #define DOCUMENT_H_
00013 
00014 #include <istream>
00015 #include <vector>
00016 
00017 #include <boost/shared_ptr.hpp>
00018 #include <sigc++/sigc++.h>
00019 
00020 #include <libtrack/Track.h>
00021 
00022 #include "DocumentDelta.h"
00023 
00027 namespace Document
00028 {
00029 
00034 class Document
00035 {
00036 public:
00040     Document(const Track::Theme & theme);
00041     
00049     Document(std::istream & source, const Track::Theme & theme);
00050     
00051     virtual ~Document();
00052     
00053     
00060     void do_command(boost::shared_ptr<DocumentDelta> delta);
00061     
00078     void preview_command(boost::shared_ptr<DocumentDelta> delta);
00079     
00084     void cancel_preview();
00085     
00087     void undo_command();
00088     
00090     void redo_command();
00091     
00098     sigc::signal<void> signal_command_run();
00099      
00104     bool get_undo_avaliable() const;
00105     
00110     bool get_redo_avaliable() const;
00111     
00113     void save(std::ostream & destination);
00114     
00119     bool is_saved() const;
00120     
00123     unsigned int get_changes_since_save() const;
00124     
00126     const Track::Track & get_track() const;
00127 protected:
00129     Track::Track track;
00130     
00132     std::vector<boost::shared_ptr<DocumentDelta> > done;
00133     
00135     std::vector<boost::shared_ptr<DocumentDelta> > undone;
00136     
00138     sigc::signal<void> m_signal_command_run;
00139     
00145     signed int commands_from_save;
00146     
00150     bool saved_in_history;
00151     
00156     boost::shared_ptr<DocumentDelta> temporary_command;
00157 };
00158 
00159 }
00160 
00161 #endif // DOCUMENT_H_

Get Racer at SourceForge.net. Fast, secure and Free Open Source software downloads

Generated at Mon Sep 6 00:41:11 2010 by Doxygen version 1.4.7 for Racer version svn335.