File indexing completed on 2022-09-27 16:29:09

0001 /**
0002  * SPDX-FileCopyrightText: (C) 2003 by Sébastien Laoût <slaout@linux62.org>
0003  * SPDX-License-Identifier: GPL-2.0-or-later
0004  */
0005 
0006 #ifndef BASKET_H
0007 #define BASKET_H
0008 
0009 #include <QGraphicsScene>
0010 #include <QXmlStreamWriter>
0011 #include <QtCore/QList>
0012 #include <QtCore/QSet>
0013 #include <QtCore/QTimer>
0014 #include <QtGui/QClipboard>
0015 #include <QtGui/QTextCursor>
0016 
0017 #include "config.h"
0018 #include "note.h" // For Note::Zone
0019 
0020 class QFrame;
0021 class QPixmap;
0022 class QPushButton;
0023 
0024 class QDomDocument;
0025 class QDomElement;
0026 
0027 class QContextMenuEvent;
0028 class QDragLeaveEvent;
0029 class QDragEnterEvent;
0030 class QDragMoveEvent;
0031 class QDropEvent;
0032 class QEvent;
0033 class QFocusEvent;
0034 class QHelpEvent;
0035 class QKeyEvent;
0036 class QMouseEvent;
0037 class QResizeEvent;
0038 class QWheelEvent;
0039 
0040 class QAction;
0041 class KDirWatch;
0042 class QKeySequence;
0043 class QUrl;
0044 
0045 namespace KIO
0046 {
0047 class Job;
0048 }
0049 
0050 class DecoratedBasket;
0051 class Note;
0052 class NoteEditor;
0053 class Tag;
0054 
0055 #ifdef HAVE_LIBGPGME
0056 class KGpgMe;
0057 #endif
0058 
0059 /**
0060  * @author Sébastien Laoût
0061  */
0062 class BasketScene : public QGraphicsScene
0063 {
0064     Q_OBJECT
0065 public:
0066     enum EncryptionTypes { NoEncryption = 0, PasswordEncryption = 1, PrivateKeyEncryption = 2 };
0067 
0068 public:
0069     /// CONSTRUCTOR AND DESTRUCTOR:
0070     BasketScene(QWidget *parent, const QString &folderName);
0071     ~BasketScene() override;
0072 
0073     /// USER INTERACTION:
0074 private:
0075     bool m_noActionOnMouseRelease;
0076     bool m_ignoreCloseEditorOnNextMouseRelease;
0077     QPointF m_pressPos;
0078     bool m_canDrag;
0079 
0080 public:
0081     void drawBackground(QPainter *painter, const QRectF &rect) override;
0082     void drawForeground(QPainter *painter, const QRectF &rect) override;
0083 
0084     void enterEvent(QEvent *);
0085     void leaveEvent(QEvent *);
0086     void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override;
0087     void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
0088     void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override;
0089     void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) override;
0090     void contextMenuEvent(QGraphicsSceneContextMenuEvent *event) override;
0091     void clickedToInsert(QGraphicsSceneMouseEvent *event, Note *clicked = nullptr, int zone = 0);
0092 private Q_SLOTS:
0093     void setFocusIfNotInPopupMenu();
0094 Q_SIGNALS:
0095     void crossReference(QString link);
0096 
0097     /// LAYOUT:
0098 private:
0099     Note *m_firstNote;
0100     int m_columnsCount;
0101     bool m_mindMap;
0102     Note *m_resizingNote;
0103     int m_pickedResizer;
0104     Note *m_movingNote;
0105     QPoint m_pickedHandle;
0106     QSet<Note *> m_notesToBeDeleted;
0107 
0108 public:
0109     qreal tmpWidth;
0110     qreal tmpHeight;
0111 
0112 public:
0113     void unsetNotesWidth();
0114     void relayoutNotes();
0115     Note *noteAt(QPointF pos);
0116     inline Note *firstNote()
0117     {
0118         return m_firstNote;
0119     }
0120     inline int columnsCount()
0121     {
0122         return m_columnsCount;
0123     }
0124     inline bool isColumnsLayout()
0125     {
0126         return m_columnsCount > 0;
0127     }
0128     inline bool isFreeLayout()
0129     {
0130         return m_columnsCount <= 0;
0131     }
0132     inline bool isMindMap()
0133     {
0134         return isFreeLayout() && m_mindMap;
0135     }
0136     Note *resizingNote()
0137     {
0138         return m_resizingNote;
0139     }
0140     void deleteNotes();
0141     Note *lastNote();
0142     void setDisposition(int disposition, int columnCount);
0143     void equalizeColumnSizes();
0144 
0145     /// NOTES INSERTION AND REMOVAL:
0146 public:
0147     /// The following methods assume that the note(s) to insert already all have 'this' as the parent basket:
0148     void appendNoteIn(Note *note, Note *in);         /// << Add @p note (and the next linked notes) as the last note(s) of the group @p in.
0149     void appendNoteAfter(Note *note, Note *after);   /// << Add @p note (and the next linked notes) just after (just below) the note @p after.
0150     void appendNoteBefore(Note *note, Note *before); /// << Add @p note (and the next linked notes) just before (just above) the note @p before.
0151     void groupNoteAfter(Note *note, Note *with);     /// << Add a group at @p with place, move @p with in it, and add @p note (and the next linked notes) just after the group.
0152     void groupNoteBefore(Note *note, Note *with);    /// << Add a group at @p with place, move @p with in it, and add @p note (and the next linked notes) just before the group.
0153     void unplugNote(Note *note);                     /// << Unplug @p note (and its child notes) from the basket (and also decrease counts...).
0154     /// <<  After that, you should delete the notes yourself. Do not call prepend/append/group... functions two times: unplug and ok
0155     void ungroupNote(Note *group); /// << Unplug @p group but put child notes at its place.
0156     /// And this one do almost all the above methods depending on the context:
0157     void insertNote(Note *note, Note *clicked, int zone, const QPointF &pos = QPointF());
0158     void insertCreatedNote(Note *note);
0159     /// And working with selections:
0160     void unplugSelection(NoteSelection *selection);
0161     void insertSelection(NoteSelection *selection, Note *after);
0162     void selectSelection(NoteSelection *selection);
0163 protected Q_SLOTS:
0164     void doCleanUp();
0165 
0166 private:
0167     void preparePlug(Note *note);
0168 
0169 private:
0170     Note *m_clickedToInsert;
0171     int m_zoneToInsert;
0172     QPointF m_posToInsert;
0173     Note *m_savedClickedToInsert;
0174     int m_savedZoneToInsert;
0175     QPointF m_savedPosToInsert;
0176     bool m_isInsertPopupMenu;
0177     QAction *m_insertMenuTitle;
0178 
0179 public:
0180     void saveInsertionData();
0181     void restoreInsertionData();
0182     void resetInsertionData();
0183 public Q_SLOTS:
0184     void insertEmptyNote(int type);
0185     void insertWizard(int type);
0186     void insertColor(const QColor &color);
0187     void insertImage(const QPixmap &image);
0188     void pasteNote(QClipboard::Mode mode = QClipboard::Clipboard);
0189     void delayedCancelInsertPopupMenu();
0190     void setInsertPopupMenu()
0191     {
0192         m_isInsertPopupMenu = true;
0193     }
0194     void cancelInsertPopupMenu()
0195     {
0196         m_isInsertPopupMenu = false;
0197     }
0198 private Q_SLOTS:
0199     void hideInsertPopupMenu();
0200     void timeoutHideInsertPopupMenu();
0201 
0202     /// TOOL TIPS:
0203 protected:
0204     void helpEvent(QGraphicsSceneHelpEvent *event) override;
0205 
0206     /// LOAD AND SAVE:
0207 private:
0208     bool m_loaded;
0209     bool m_loadingLaunched;
0210     bool m_locked;
0211     bool m_shouldConvertPlainTextNotes;
0212     QFrame *m_decryptBox;
0213     QPushButton *m_button;
0214     int m_encryptionType;
0215     QString m_encryptionKey;
0216 #ifdef HAVE_LIBGPGME
0217     KGpgMe *m_gpg;
0218 #endif
0219     QTimer m_inactivityAutoLockTimer;
0220     QTimer m_commitdelay;
0221     void enableActions();
0222 
0223 private Q_SLOTS:
0224     void loadNotes(const QDomElement &notes, Note *parent);
0225     void saveNotes(QXmlStreamWriter &stream, Note *parent);
0226     void unlock();
0227 protected Q_SLOTS:
0228     void inactivityAutoLockTimeout();
0229 public Q_SLOTS:
0230     void load();
0231     void loadProperties(const QDomElement &properties);
0232     void saveProperties(QXmlStreamWriter &stream);
0233     bool save();
0234     void commitEdit();
0235     void reload();
0236 
0237 public:
0238     bool isEncrypted();
0239     bool isFileEncrypted();
0240     bool isLocked()
0241     {
0242         return m_locked;
0243     };
0244     void lock();
0245     bool isLoaded()
0246     {
0247         return m_loaded;
0248     };
0249     bool loadingLaunched()
0250     {
0251         return m_loadingLaunched;
0252     };
0253     int encryptionType()
0254     {
0255         return m_encryptionType;
0256     };
0257     QString encryptionKey()
0258     {
0259         return m_encryptionKey;
0260     };
0261     bool setProtection(int type, QString key);
0262     bool saveAgain();
0263 
0264     /// BACKGROUND:
0265 private:
0266     QColor m_backgroundColorSetting;
0267     QString m_backgroundImageName;
0268     QPixmap *m_backgroundPixmap;
0269     QPixmap *m_opaqueBackgroundPixmap;
0270     QPixmap *m_selectedBackgroundPixmap;
0271     bool m_backgroundTiled;
0272     QColor m_textColorSetting;
0273 
0274 public:
0275     inline bool hasBackgroundImage()
0276     {
0277         return m_backgroundPixmap != nullptr;
0278     }
0279     inline const QPixmap *backgroundPixmap()
0280     {
0281         return m_backgroundPixmap;
0282     }
0283     inline bool isTiledBackground()
0284     {
0285         return m_backgroundTiled;
0286     }
0287     inline QString backgroundImageName()
0288     {
0289         return m_backgroundImageName;
0290     }
0291     inline QColor backgroundColorSetting()
0292     {
0293         return m_backgroundColorSetting;
0294     }
0295     inline QColor textColorSetting()
0296     {
0297         return m_textColorSetting;
0298     }
0299     QColor backgroundColor() const;
0300     QColor textColor() const;
0301     void setAppearance(const QString &icon, const QString &name, const QString &backgroundImage, const QColor &backgroundColor, const QColor &textColor);
0302     void blendBackground(QPainter &painter, const QRectF &rect, qreal xPainter = -1, qreal yPainter = -1, bool opaque = false, QPixmap *bg = nullptr);
0303     void blendBackground(QPainter &painter, const QRectF &rect, bool opaque, QPixmap *bg);
0304     void unbufferizeAll();
0305     void subscribeBackgroundImages();
0306     void unsubscribeBackgroundImages();
0307 
0308     /// KEYBOARD SHORTCUT:
0309 public:
0310     QAction *m_action;
0311 
0312 private:
0313     int m_shortcutAction;
0314 private Q_SLOTS:
0315     void activatedShortcut();
0316 
0317 public:
0318     QKeySequence shortcut()
0319     {
0320         return m_action->shortcut();
0321     }
0322     int shortcutAction()
0323     {
0324         return m_shortcutAction;
0325     }
0326     void setShortcut(QKeySequence shortcut, int action);
0327 
0328     /// USER INTERACTION:
0329 private:
0330     Note *m_hoveredNote;
0331     int m_hoveredZone;
0332     bool m_lockedHovering;
0333     bool m_underMouse;
0334     QRectF m_inserterRect;
0335     bool m_inserterShown;
0336     bool m_inserterSplit;
0337     bool m_inserterTop;
0338     bool m_inserterGroup;
0339     void placeInserter(Note *note, int zone);
0340     void removeInserter();
0341 
0342 public:
0343     //  bool inserterShown() { return m_inserterShown; }
0344     bool inserterSplit()
0345     {
0346         return m_inserterSplit;
0347     }
0348     bool inserterGroup()
0349     {
0350         return m_inserterGroup;
0351     }
0352 public Q_SLOTS:
0353     void doHoverEffects(Note *note, Note::Zone zone, const QPointF &pos = QPointF(0, 0)); /// << @p pos is optional and only used to show the link target in the statusbar
0354     void doHoverEffects(const QPointF &pos);
0355     void doHoverEffects(); // The same, but using the current cursor position
0356     void mouseEnteredEditorWidget();
0357 
0358 public:
0359     void popupTagsMenu(Note *note);
0360     void popupEmblemMenu(Note *note, int emblemNumber);
0361     void addTagToSelectedNotes(Tag *tag);
0362     void removeTagFromSelectedNotes(Tag *tag);
0363     void removeAllTagsFromSelectedNotes();
0364     void addStateToSelectedNotes(State *state);
0365     void changeStateOfSelectedNotes(State *state);
0366     bool selectedNotesHaveTags();
0367     const QRectF &inserterRect()
0368     {
0369         return m_inserterRect;
0370     }
0371     bool inserterShown()
0372     {
0373         return m_inserterShown;
0374     }
0375     void drawInserter(QPainter &painter, qreal xPainter, qreal yPainter);
0376     DecoratedBasket *decoration();
0377     State *stateForTagFromSelectedNotes(Tag *tag);
0378 public Q_SLOTS:
0379     void activatedTagShortcut(Tag *tag);
0380     void recomputeAllStyles();
0381     void removedStates(const QList<State *> &deletedStates);
0382     void toggledTagInMenu(QAction *act);
0383     void toggledStateInMenu(QAction *act);
0384     void unlockHovering();
0385     void disableNextClick();
0386 
0387 public:
0388     Note *m_tagPopupNote;
0389 
0390 private:
0391     Tag *m_tagPopup;
0392     QTime m_lastDisableClick;
0393 
0394     /// SELECTION:
0395 private:
0396     bool m_isSelecting;
0397     bool m_selectionStarted;
0398     bool m_selectionInvert;
0399     QPointF m_selectionBeginPoint;
0400     QPointF m_selectionEndPoint;
0401     QRectF m_selectionRect;
0402     QTimer m_autoScrollSelectionTimer;
0403     void stopAutoScrollSelection();
0404 private Q_SLOTS:
0405     void doAutoScrollSelection();
0406 
0407 public:
0408     inline bool isSelecting()
0409     {
0410         return m_isSelecting;
0411     }
0412     inline const QRectF &selectionRect()
0413     {
0414         return m_selectionRect;
0415     }
0416     void selectNotesIn(const QRectF &rect, bool invertSelection, bool unselectOthers = true);
0417     void resetWasInLastSelectionRect();
0418     void selectAll();
0419     void unselectAll();
0420     void invertSelection();
0421     void unselectAllBut(Note *toSelect);
0422     void invertSelectionOf(Note *toSelect);
0423     QColor selectionRectInsideColor();
0424     Note *theSelectedNote();
0425     NoteSelection *selectedNotes();
0426 
0427     /// BLANK SPACES DRAWING:
0428 private:
0429     QList<QRectF> m_blankAreas;
0430     void recomputeBlankRects();
0431     QWidget *m_cornerWidget;
0432 
0433     /// COMMUNICATION WITH ITS CONTAINER:
0434 Q_SIGNALS:
0435     void postMessage(const QString &message);      /// << Post a temporary message in the statusBar.
0436     void setStatusBarText(const QString &message); /// << Set the permanent statusBar text or reset it if message isEmpty().
0437     void resetStatusBarText();                     /// << Equivalent to setStatusBarText(QString()).
0438     void propertiesChanged(BasketScene *basket);
0439     void countsChanged(BasketScene *basket);
0440 public Q_SLOTS:
0441     void linkLookChanged();
0442     void signalCountsChanged();
0443 
0444 private:
0445     QTimer m_timerCountsChanged;
0446 private Q_SLOTS:
0447     void countsChangedTimeOut();
0448 
0449     /// NOTES COUNTING:
0450 public:
0451     void addSelectedNote()
0452     {
0453         ++m_countSelecteds;
0454         signalCountsChanged();
0455     }
0456     void removeSelectedNote()
0457     {
0458         --m_countSelecteds;
0459         signalCountsChanged();
0460     }
0461     void resetSelectedNote()
0462     {
0463         m_countSelecteds = 0;
0464         signalCountsChanged();
0465     } // FIXME: Useful ???
0466     int count()
0467     {
0468         return m_count;
0469     }
0470     int countFounds()
0471     {
0472         return m_countFounds;
0473     }
0474     int countSelecteds()
0475     {
0476         return m_countSelecteds;
0477     }
0478 
0479 private:
0480     int m_count;
0481     int m_countFounds;
0482     int m_countSelecteds;
0483 
0484     /// PROPERTIES:
0485 public:
0486     QString basketName()
0487     {
0488         return m_basketName;
0489     }
0490     QString icon()
0491     {
0492         return m_icon;
0493     }
0494     QString folderName()
0495     {
0496         return m_folderName;
0497     }
0498     QString fullPath();
0499     QString fullPathForFileName(const QString &fileName); // Full path of an [existing or not] note in this basket
0500     static QString fullPathForFolderName(const QString &folderName);
0501 
0502 private:
0503     QString m_basketName;
0504     QString m_icon;
0505     QString m_folderName;
0506 
0507     /// ACTIONS ON SELECTED NOTES FROM THE INTERFACE:
0508 public Q_SLOTS:
0509     void noteEdit(Note *note = nullptr, bool justAdded = false, const QPointF &clickedPoint = QPointF());
0510     void showEditedNoteWhileFiltering();
0511     void noteDelete();
0512     void noteDeleteWithoutConfirmation(bool deleteFilesToo = true);
0513     void noteCopy();
0514     void noteCut();
0515     void clearFormattingNote(Note *note = nullptr);
0516     void noteOpen(Note *note = nullptr);
0517     void noteOpenWith(Note *note = nullptr);
0518     void noteSaveAs();
0519     void noteGroup();
0520     void noteUngroup();
0521     void noteMoveOnTop();
0522     void noteMoveOnBottom();
0523     void noteMoveNoteUp();
0524     void noteMoveNoteDown();
0525     void moveSelectionTo(Note *here, bool below);
0526 
0527 public:
0528     enum CopyMode { CopyToClipboard, CopyToSelection, CutToClipboard };
0529     void doCopy(CopyMode copyMode);
0530     bool selectionIsOneGroup();
0531     Note *selectedGroup();
0532     Note *firstSelected();
0533     Note *lastSelected();
0534 
0535     /// NOTES EDITION:
0536 private:
0537     NoteEditor *m_editor;
0538     // QWidget    *m_rightEditorBorder;
0539     bool m_redirectEditActions;
0540     bool m_editorTrackMouseEvent;
0541     qreal m_editorWidth;
0542     qreal m_editorHeight;
0543     QTimer m_inactivityAutoSaveTimer;
0544     bool m_doNotCloseEditor;
0545     QTextCursor m_textCursor;
0546 
0547 public:
0548     bool isDuringEdit()
0549     {
0550         return m_editor;
0551     }
0552     bool redirectEditActions()
0553     {
0554         return m_redirectEditActions;
0555     }
0556     bool hasTextInEditor();
0557     bool hasSelectedTextInEditor();
0558     bool selectedAllTextInEditor();
0559     Note *editedNote();
0560 protected Q_SLOTS:
0561     void selectionChangedInEditor();
0562     void contentChangedInEditor();
0563     void inactivityAutoSaveTimeout();
0564 public Q_SLOTS:
0565     void editorCursorPositionChanged();
0566 
0567 private:
0568     qreal m_editorX;
0569     qreal m_editorY;
0570 public Q_SLOTS:
0571     void placeEditor(bool andEnsureVisible = false);
0572     void placeEditorAndEnsureVisible();
0573     bool closeEditor(bool deleteEmptyNote = true);
0574     void closeEditorDelayed();
0575     void updateEditorAppearance();
0576     void editorPropertiesChanged();
0577     void openBasket();
0578     void closeBasket();
0579 
0580     /// FILTERING:
0581 public Q_SLOTS:
0582     void newFilter(const FilterData &data, bool andEnsureVisible = true);
0583     void filterAgain(bool andEnsureVisible = true);
0584     void filterAgainDelayed();
0585     bool isFiltering();
0586 
0587     /// DRAG AND DROP:
0588 private:
0589     bool m_isDuringDrag;
0590     QList<Note *> m_draggedNotes;
0591 
0592 public:
0593     static void acceptDropEvent(QGraphicsSceneDragDropEvent *event, bool preCond = true);
0594     void dropEvent(QGraphicsSceneDragDropEvent *event) override;
0595     void blindDrop(QGraphicsSceneDragDropEvent *event);
0596     void blindDrop(const QMimeData *mimeData, Qt::DropAction dropAction, QObject *source);
0597     bool isDuringDrag()
0598     {
0599         return m_isDuringDrag;
0600     }
0601     QList<Note *> draggedNotes()
0602     {
0603         return m_draggedNotes;
0604     }
0605 
0606 protected:
0607     void dragEnterEvent(QGraphicsSceneDragDropEvent *) override;
0608     void dragMoveEvent(QGraphicsSceneDragDropEvent *event) override;
0609     void dragLeaveEvent(QGraphicsSceneDragDropEvent *) override;
0610 public Q_SLOTS:
0611     void slotCopyingDone2(KIO::Job *job, const QUrl &from, const QUrl &to);
0612 
0613 public:
0614     Note *noteForFullPath(const QString &path);
0615 
0616     /// EXPORTATION:
0617 public:
0618     QList<State *> usedStates();
0619 
0620 public:
0621     void listUsedTags(QList<Tag *> &list);
0622 
0623     /// MANAGE FOCUS:
0624 private:
0625     Note *m_focusedNote;
0626 
0627 public:
0628     void setFocusedNote(Note *note);
0629     void focusANote();
0630     void focusANonSelectedNoteAbove(bool inSameColumn);
0631     void focusANonSelectedNoteBelow(bool inSameColumn);
0632     void focusANonSelectedNoteBelowOrThenAbove();
0633     void focusANonSelectedNoteAboveOrThenBelow();
0634     Note *focusedNote()
0635     {
0636         return m_focusedNote;
0637     }
0638     Note *firstNoteInStack();
0639     Note *lastNoteInStack();
0640     Note *firstNoteShownInStack();
0641     Note *lastNoteShownInStack();
0642     void selectRange(Note *start, Note *end, bool unselectOthers = true); /// FIXME: Not really a focus related method!
0643     void ensureNoteVisible(Note *note);
0644     void keyPressEvent(QKeyEvent *event) override;
0645     void focusInEvent(QFocusEvent *) override;
0646     void focusOutEvent(QFocusEvent *) override;
0647     QRectF noteVisibleRect(Note *note); // clipped global (desktop as origin) rectangle
0648     Note *firstNoteInGroup();
0649     Note *noteOnHome();
0650     Note *noteOnEnd();
0651 
0652     enum NoteOn { LEFT_SIDE = 1, RIGHT_SIDE, TOP_SIDE, BOTTOM_SIDE };
0653     Note *noteOn(NoteOn side);
0654 
0655     /// REIMPLEMENTED:
0656 public:
0657     void deleteFiles();
0658     bool convertTexts();
0659 
0660 public:
0661     void wheelEvent(QGraphicsSceneWheelEvent *event) override;
0662 
0663 public:
0664     Note *m_startOfShiftSelectionNote;
0665 
0666     /// THE NEW FILE WATCHER:
0667 private:
0668     KDirWatch *m_watcher;
0669     QTimer m_watcherTimer;
0670     QList<QString> m_modifiedFiles;
0671 
0672 public:
0673     void addWatchedFile(const QString &fullPath);
0674     void removeWatchedFile(const QString &fullPath);
0675 private Q_SLOTS:
0676     void watchedFileModified(const QString &fullPath);
0677     void watchedFileDeleted(const QString &fullPath);
0678     void updateModifiedNotes();
0679 
0680     /// FROM OLD ARCHITECTURE **********************
0681 
0682 public Q_SLOTS:
0683 
0684     void showFrameInsertTo()
0685     {
0686     }
0687     void resetInsertTo()
0688     {
0689     }
0690 
0691     void computeInsertPlace(const QPointF & /*cursorPosition*/)
0692     {
0693     }
0694 
0695 public:
0696     friend class SystemTray;
0697 
0698     /// SPEED OPTIMIZATION
0699 private:
0700     bool m_finishLoadOnFirstShow;
0701     bool m_relayoutOnNextShow;
0702 
0703 public:
0704     void aboutToBeActivated();
0705 
0706     QGraphicsView *graphicsView()
0707     {
0708         return m_view;
0709     }
0710 
0711 private:
0712     QGraphicsView *m_view;
0713 };
0714 
0715 #endif // BASKET_H