"Fossies" - the Fresh Open Source Software Archive

Member "regexxer-0.10/src/filebufferundo.h" (6 Oct 2011, 2251 Bytes) of package /linux/privat/old/regexxer-0.10.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "filebufferundo.h" see the Fossies "Dox" file reference documentation.

    1 /*
    2  * Copyright (c) 2002-2007  Daniel Elstner  <daniel.kitta@gmail.com>
    3  *
    4  * This file is part of regexxer.
    5  *
    6  * regexxer is free software; you can redistribute it and/or modify
    7  * it under the terms of the GNU General Public License as published by
    8  * the Free Software Foundation; either version 2 of the License, or
    9  * (at your option) any later version.
   10  *
   11  * regexxer is distributed in the hope that it will be useful,
   12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
   13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   14  * GNU General Public License for more details.
   15  *
   16  * You should have received a copy of the GNU General Public License
   17  * along with regexxer; if not, write to the Free Software Foundation,
   18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
   19  */
   20 
   21 #ifndef REGEXXER_FILEBUFFERUNDO_H_INCLUDED
   22 #define REGEXXER_FILEBUFFERUNDO_H_INCLUDED
   23 
   24 #include "undostack.h"
   25 #include "fileshared.h"
   26 
   27 
   28 namespace Regexxer
   29 {
   30 
   31 class FileBuffer;
   32 
   33 class FileBufferAction : public UndoAction
   34 {
   35 protected:
   36   explicit FileBufferAction(FileBuffer& filebuffer)
   37     : buffer_ (filebuffer) {}
   38 
   39   FileBuffer& buffer() { return buffer_; }
   40 
   41 private:
   42   FileBuffer& buffer_;
   43 };
   44 
   45 class FileBufferActionInsert : public FileBufferAction
   46 {
   47 public:
   48   FileBufferActionInsert(FileBuffer& filebuffer, int offset, const Glib::ustring& text);
   49   virtual ~FileBufferActionInsert();
   50 
   51 private:
   52   Glib::ustring text_;
   53   int           offset_;
   54 
   55   virtual bool do_undo(const sigc::slot<bool>& pulse);
   56 };
   57 
   58 class FileBufferActionErase : public FileBufferAction
   59 {
   60 public:
   61   FileBufferActionErase(FileBuffer& filebuffer, int offset, const Glib::ustring& text);
   62   virtual ~FileBufferActionErase();
   63 
   64 private:
   65   Glib::ustring text_;
   66   int           offset_;
   67 
   68   virtual bool do_undo(const sigc::slot<bool>& pulse);
   69 };
   70 
   71 class FileBufferActionRemoveMatch : public FileBufferAction
   72 {
   73 public:
   74   FileBufferActionRemoveMatch(FileBuffer& filebuffer, int offset, const MatchDataPtr& match);
   75   virtual ~FileBufferActionRemoveMatch();
   76 
   77   void weak_notify();
   78 
   79 private:
   80   MatchDataPtr  match_;
   81   int           offset_;
   82 
   83   virtual bool do_undo(const sigc::slot<bool>& pulse);
   84 };
   85 
   86 } // namespace Regexxer
   87 
   88 #endif /* REGEXXER_FILEBUFFERUNDO_H_INCLUDED */