Changeset View
Changeset View
Standalone View
Standalone View
src/buffer/katetextbuffer.h
Context not available. | |||||
39 | // encoding prober | 39 | // encoding prober | ||
---|---|---|---|---|---|
40 | #include <KEncodingProber> | 40 | #include <KEncodingProber> | ||
41 | 41 | | |||
42 | class KCompressionDevice; | ||||
43 | | ||||
42 | namespace Kate | 44 | namespace Kate | ||
43 | { | 45 | { | ||
44 | 46 | | |||
Context not available. | |||||
70 | * Empty means one empty line in one block. | 72 | * Empty means one empty line in one block. | ||
71 | * @param parent parent qobject | 73 | * @param parent parent qobject | ||
72 | * @param blockSize block size in lines the buffer should try to hold, default 64 lines | 74 | * @param blockSize block size in lines the buffer should try to hold, default 64 lines | ||
75 | * @param alwaysUseKAuth only set this for unit testing purposes | ||||
73 | */ | 76 | */ | ||
74 | explicit TextBuffer(KTextEditor::DocumentPrivate *parent, int blockSize = 64, bool alwaysUseKAuth = false); | 77 | explicit TextBuffer(KTextEditor::DocumentPrivate *parent, int blockSize = 64, bool alwaysUseKAuth = false); | ||
75 | 78 | | |||
Context not available. | |||||
428 | void textRemoved(const KTextEditor::Range &range, const QString &text); | 431 | void textRemoved(const KTextEditor::Range &range, const QString &text); | ||
429 | 432 | | |||
430 | private: | 433 | private: | ||
434 | | ||||
435 | /** | ||||
436 | * Save result which indicates an abstract reason why the operation has | ||||
437 | * failed | ||||
438 | */ | ||||
439 | enum class SaveResult { | ||||
440 | Failed = 0, | ||||
441 | MissingPermissions, | ||||
442 | Success | ||||
443 | }; | ||||
444 | | ||||
431 | /** | 445 | /** | ||
432 | * Find block containing given line. | 446 | * Find block containing given line. | ||
433 | * @param line we want to find block for this line | 447 | * @param line we want to find block for this line | ||
Context not available. | |||||
471 | */ | 485 | */ | ||
472 | void markModifiedLinesAsSaved(); | 486 | void markModifiedLinesAsSaved(); | ||
473 | 487 | | |||
488 | /** | ||||
489 | * Save the current buffer content to the given already opened device | ||||
490 | * | ||||
491 | * @param filename path name for display/debugging purposes | ||||
492 | * @param saveFile open device to write the buffer to | ||||
493 | */ | ||||
494 | bool saveBuffer(const QString &filename, KCompressionDevice &saveFile); | ||||
495 | | ||||
496 | /** | ||||
497 | * Attempt to save the buffer content in the given filename location using | ||||
498 | * current privileges. | ||||
499 | */ | ||||
500 | SaveResult saveBufferUnprivileged(const QString &filename); | ||||
501 | | ||||
502 | /** | ||||
503 | * Attempt to save the buffer content in the given filename location using | ||||
504 | * escalated privileges. | ||||
505 | */ | ||||
506 | bool saveBufferEscalated(const QString &filename); | ||||
507 | | ||||
474 | public: | 508 | public: | ||
475 | /** | 509 | /** | ||
476 | * Gets the document to which this buffer is bound. | 510 | * Gets the document to which this buffer is bound. | ||
Context not available. |