Changeset View
Changeset View
Standalone View
Standalone View
src/document/katedocument.h
Show First 20 Lines • Show All 261 Lines • ▼ Show 20 Line(s) | 261 | //BEGIN LINE BASED INSERT/REMOVE STUFF (editStart() and editEnd() included) | |||
---|---|---|---|---|---|
262 | /** | 262 | /** | ||
263 | * Add a string in the given line/column | 263 | * Add a string in the given line/column | ||
264 | * @param line line number | 264 | * @param line line number | ||
265 | * @param col column | 265 | * @param col column | ||
266 | * @param s string to be inserted | 266 | * @param s string to be inserted | ||
267 | * @return true on success | 267 | * @return true on success | ||
268 | */ | 268 | */ | ||
269 | bool editInsertText(int line, int col, const QString &s); | 269 | bool editInsertText(int line, int col, const QString &s); | ||
270 | | ||||
270 | /** | 271 | /** | ||
271 | * Remove a string in the given line/column | 272 | * Remove a string in the given line/column | ||
272 | * @param line line number | 273 | * @param line line number | ||
273 | * @param col column | 274 | * @param col column | ||
274 | * @param len length of text to be removed | 275 | * @param len length of text to be removed | ||
275 | * @return true on success | 276 | * @return true on success | ||
276 | */ | 277 | */ | ||
277 | bool editRemoveText(int line, int col, int len); | 278 | bool editRemoveText(int line, int col, int len); | ||
Show All 14 Lines | |||||
292 | * was needed/added you can grab with @p newLineAdded. | 293 | * was needed/added you can grab with @p newLineAdded. | ||
293 | * @param line line number | 294 | * @param line line number | ||
294 | * @param col column | 295 | * @param col column | ||
295 | * @param newLine if true, force a new line | 296 | * @param newLine if true, force a new line | ||
296 | * @param newLineAdded return value is true, if new line was added (may be 0) | 297 | * @param newLineAdded return value is true, if new line was added (may be 0) | ||
297 | * @return true on success | 298 | * @return true on success | ||
298 | */ | 299 | */ | ||
299 | bool editWrapLine(int line, int col, bool newLine = true, bool *newLineAdded = nullptr); | 300 | bool editWrapLine(int line, int col, bool newLine = true, bool *newLineAdded = nullptr); | ||
301 | | ||||
300 | /** | 302 | /** | ||
301 | * Unwrap @p line. If @p removeLine is true, we force to join the lines. If | 303 | * Unwrap @p line. If @p removeLine is true, we force to join the lines. If | ||
302 | * @p removeLine is true, @p length is ignored (eg not needed). | 304 | * @p removeLine is true, @p length is ignored (eg not needed). | ||
303 | * @param line line number | 305 | * @param line line number | ||
304 | * @param removeLine if true, force to remove the next line | 306 | * @param removeLine if true, force to remove the next line | ||
305 | * @return true on success | 307 | * @return true on success | ||
306 | */ | 308 | */ | ||
307 | bool editUnWrapLine(int line, bool removeLine = true, int length = 0); | 309 | bool editUnWrapLine(int line, bool removeLine = true, int length = 0); | ||
308 | 310 | | |||
309 | /** | 311 | /** | ||
310 | * Insert a string at the given line. | 312 | * Insert a string at the given line. | ||
311 | * @param line line number | 313 | * @param line line number | ||
312 | * @param s string to insert | 314 | * @param s string to insert | ||
313 | * @return true on success | 315 | * @return true on success | ||
314 | */ | 316 | */ | ||
315 | bool editInsertLine(int line, const QString &s); | 317 | bool editInsertLine(int line, const QString &s); | ||
318 | | ||||
316 | /** | 319 | /** | ||
317 | * Remove a line | 320 | * Remove a line | ||
318 | * @param line line number | 321 | * @param line line number | ||
319 | * @return true on success | 322 | * @return true on success | ||
320 | */ | 323 | */ | ||
321 | bool editRemoveLine(int line); | 324 | bool editRemoveLine(int line); | ||
322 | 325 | | |||
323 | bool editRemoveLines(int from, int to); | 326 | bool editRemoveLines(int from, int to); | ||
324 | 327 | | |||
325 | /** | 328 | /** | ||
326 | * Remove a line | 329 | * Warp a line | ||
327 | * @param startLine line to begin wrapping | 330 | * @param startLine line to begin wrapping | ||
328 | * @param endLine line to stop wrapping | 331 | * @param endLine line to stop wrapping | ||
329 | * @return true on success | 332 | * @return true on success | ||
330 | */ | 333 | */ | ||
331 | bool wrapText(int startLine, int endLine); | 334 | bool wrapText(int startLine, int endLine); | ||
335 | | ||||
336 | /** | ||||
337 | * Wrap lines touched by the selection with respect of existing paragraphs. | ||||
338 | * To do so will the paragraph prior to the wrap joined as one single line | ||||
339 | * which cause an almost perfect wrapped paragraph as long as there are no | ||||
340 | * unneeded spaces exist or some formatting like this comment block. | ||||
341 | * Without any selection the current line is wrapped. | ||||
342 | * Empty lines around each paragraph are untouched. | ||||
343 | * @param first line to begin wrapping | ||||
344 | * @param last line to stop wrapping | ||||
345 | * @return true on success | ||||
346 | */ | ||||
347 | bool wrapParagraph(int first, int last); | ||||
332 | //END LINE BASED INSERT/REMOVE STUFF | 348 | //END LINE BASED INSERT/REMOVE STUFF | ||
333 | 349 | | |||
334 | Q_SIGNALS: | 350 | Q_SIGNALS: | ||
335 | /** | 351 | /** | ||
336 | * Emitted when text from @p line was wrapped at position pos onto line @p nextLine. | 352 | * Emitted when text from @p line was wrapped at position pos onto line @p nextLine. | ||
337 | */ | 353 | */ | ||
338 | void editLineWrapped(int line, int col, int len); | 354 | void editLineWrapped(int line, int col, int len); | ||
339 | 355 | | |||
▲ Show 20 Lines • Show All 1074 Lines • Show Last 20 Lines |