knode
kncomposer.cpp
Go to the documentation of this file.
147 void KNLineEditSpell::spellCheckerMisspelling( const QString &_text, const QStringList &, unsigned int pos)
152 void KNLineEditSpell::spellCheckerCorrected( const QString &old, const QString &corr, unsigned int pos)
163 KNComposer::KNComposer( KNLocalArticle::Ptr a, const QString &text, const QString &unwraped, bool firstEdit, bool dislikesCopies, bool createCopy, bool allowMail )
166 n_eeds8Bit(true), v_alidated(false), a_uthorDislikesMailCopies(dislikesCopies), e_xternalEdited(false), e_xternalEditor(0),
199 QDBusConnection::sessionBus().registerObject( "/Composer", this, QDBusConnection::ExportScriptableSlots );
272 connect( a_ctRemoveAttachment, SIGNAL(triggered(bool)), v_iew, SLOT(removeCurrentAttachment()) );
276 connect( a_ctAttachmentProperties, SIGNAL(triggered(bool)), v_iew, SLOT(editCurrentAttachment()) );
308 a_ctAutoSpellChecking = new KToggleAction( KIcon( "tools-check-spelling" ), i18n("&Automatic Spellchecking"), this );
314 connect( v_iew->editor(), SIGNAL(checkSpellingChanged(bool)), this, SLOT(slotUpdateCheckSpellChecking(bool)));
352 a_ctSpellCheck = KStandardAction::spelling ( v_iew->editor(), SLOT(checkSpelling()), actionCollection());
537 KMessageBox::sorry( this, i18n( "Your email address does not appears to be valid. Please modify it." ) );
557 KMessageBox::sorry(this, i18n("You are crossposting to more than 12 newsgroups.\nPlease remove all newsgroups in which your article is off-topic."));
562 if ( KMessageBox::warningYesNo( this, i18n("You are crossposting to more than five newsgroups.\nPlease reconsider whether this is really useful\nand remove groups in which your article is off-topic.\nDo you want to re-edit the article or send it anyway?"),
563 QString(), KGuiItem(i18n("&Send")), KGuiItem(i18nc("edit article","&Edit")) ) != KMessageBox::Yes )
573 QString(), KGuiItem(i18n("&Send")), KGuiItem(i18nc("edit article","&Edit")), "missingFollowUpTo" )
579 KMessageBox::sorry(this, i18n("You are directing replies to more than 12 newsgroups.\nPlease remove some newsgroups from the \"Followup-To\" header."));
584 if ( KMessageBox::warningYesNo( this, i18n("You are directing replies to more than five newsgroups.\nPlease reconsider whether this is really useful.\nDo you want to re-edit the article or send it anyway?"),
585 QString(), KGuiItem(i18n("&Send")),KGuiItem(i18nc("edit article","&Edit")) ) != KMessageBox::Yes )
644 KMessageBox::sorry(this, i18n("Your message contains characters which are not included\nin the \"us-ascii\" character set; please choose\na suitable character set from the \"Options\" menu."));
655 if ( KMessageBox::warningYesNo( this, i18n("Your article seems to consist entirely of quoted text;\ndo you want to re-edit the article or send it anyway?"),
656 QString(), KGuiItem(i18n("&Send")), KGuiItem(i18nc("edit article","&Edit")) ) != KMessageBox::Yes )
675 if ( KMessageBox::warningYesNo( this, i18n("Your signature is more than 8 lines long.\nYou should shorten it to match the widely accepted limit of 4 lines.\nDo you want to re-edit the article or send it anyway?"),
676 QString(), KGuiItem(i18n("&Send")), KGuiItem(i18nc("edit article","&Edit")) ) != KMessageBox::Yes )
680 KMessageBox::information( this, i18n("Your signature exceeds the widely-accepted limit of 4 lines:\nplease consider shortening your signature;\notherwise, you will probably annoy your readers."),
729 const KPIMIdentities::Identity identity = KNGlobals::self()->identityManager()->identityForUoid( v_iew->selectedIdentity() );
754 a_rticle->mailCopiesTo()->fromUnicodeString( identity.property( "Mail-Copies-To" ).toString(), mCharset.toLatin1() );
774 a_rticle->newsgroups()->fromUnicodeString( v_iew->groups().join( QString( ',' ) ), KMime::Headers::Latin1 );
793 a_rticle->followUpTo()->fromUnicodeString( v_iew->followupTo().join( QString( ',' ) ), KMime::Headers::Latin1 );
812 for ( QList<KNAttachment::Ptr>::Iterator it = mDeletedAttachments.begin(); it != mDeletedAttachments.end(); ++it )
895 if(!v_iew->editor()->document()->isModified() && !a_ttChanged) { // nothing to save, don't show nag screen
902 switch ( KMessageBox::warningYesNoCancel( this, i18n("Do you want to save this article in the draft folder?"),
1190 if ( KMessageBox::warningContinueCancel( this, i18n("The poster does not want a mail copy of your reply (Mail-Copies-To: nobody);\nplease respect their request."),
1244 int newCS = KNHelper::selectDialog(this, i18n("Select Charset"), a_ctSetCharset->items(), a_ctSetCharset->currentItem());
1269 if (KMessageBox::warningContinueCancel( this, i18n("This will replace all text you have written.")) == KMessageBox::Continue) {
1283 KMessageBox::sorry(this, i18n("No editor configured.\nPlease do this in the settings dialog."));
1326 connect(e_xternalEditor, SIGNAL(finished(int,QProcess::ExitStatus)),this, SLOT(slotEditorFinished(int,QProcess::ExitStatus)));
1329 KMessageBox::error(this, i18n("Unable to start external editor.\nPlease check your configuration in the settings dialog."));
1337 a_ctExternalEditor->setEnabled(false); // block other edit action while the editor is running...
1375 KShortcutsDialog::configure(actionCollection(), KShortcutsEditor::LetterShortcutsAllowed, this, true);
1534 KNComposer::AttachmentPropertiesDlg::AttachmentPropertiesDlg( KNAttachment::Ptr a, QWidget *parent ) :
1632 else if ( n_onTextAsText && m_imeType->text().indexOf( "text/", 0, Qt::CaseInsensitive ) != -1 &&
1634 i18n("You have changed the mime-type of this non-textual attachment\nto text. This might cause an error while loading or encoding the file.\nProceed?")
const QString emailRecipient() const
Returns the email recipient of this message (as type by the user in the To: field).
Definition: kncomposerview.cpp:273
void focusNextPrevEdit(const QWidget *aCur, bool aNext)
Gives the focus to the next/previous edition widget (group, to, subject, body, etc.)
Definition: kncomposerview.cpp:151
void setCodec(QTextCodec *codec)
void setText(const QString &text)
void spellCheckerCorrected(const QString &old, const QString &corr, unsigned int pos)
Definition: kncomposer.cpp:152
QByteArray fromUnicode(const QString &str) const
bool isAttachmentViewVisible() const
Indicates whether the attachment view is visible or not.
Definition: kncomposerview.h:92
virtual void contextMenuEvent(QContextMenuEvent *e)
Definition: kncomposer.cpp:71
const QString from()
Returns the sender full name and email address to use in a From: header of a message.
Definition: kncomposerview.cpp:224
void setIdentity(uint uoid)
Changes the selected identity and update related edit lines.
Definition: kncomposerview.cpp:206
boost::shared_ptr< KNLocalArticle > Ptr
Shared pointer to a KNLocalArticle. To be used instead of raw KNLocalArticle*.
Definition: knarticle.h:216
const QMimeData * mimeData() const
virtual QByteArray name() const =0
static void saveWindowSize(const QString &name, const QSize &s)
Definition: utilities.cpp:205
QString readLine(qint64 maxlen)
void addWidget(QWidget *widget, int row, int column, QFlags< Qt::AlignmentFlag > alignment)
void apply()
Apply the change to the attachment passed to the constructor.
Definition: kncomposer.cpp:1618
virtual QByteArray text(quint32 serialNumber) const =0
QStringList split(const QString &sep, SplitBehavior behavior, Qt::CaseSensitivity cs) const
boost::shared_ptr< KNGroupListData > Ptr
Shared pointer to a KNGroupListData.
Definition: kngroupmanager.h:59
Definition: kncomposer.h:48
void setIcon(const QIcon &icon)
void setEmailRecipient(const QString &to)
Sets the email recipient list as a string.
Definition: kncomposerview.cpp:278
bool registerObject(const QString &path, QObject *object, QFlags< QDBusConnection::RegisterOption > options)
bool isEmpty() const
void slotEditorFinished(int, QProcess::ExitStatus)
Definition: kncomposer.cpp:1467
static void restoreWindowSize(const QString &name, QWidget *d, const QSize &defaultSize)
Definition: utilities.cpp:212
Definition: kncomposer.h:47
void slotAttachmentRemoved(KNAttachment::Ptr attachment, bool last)
Called by the View when an attachment was removed.
Definition: kncomposer.cpp:1142
QDBusConnection sessionBus()
QString join(const QString &separator) const
int length() const
KNAttachment represents a file that is or will be attached to an article.
Definition: knarticle.h:277
void setEditable(bool editable)
QString from() const
void setMessageMode(KNComposer::MessageMode mode)
Set the message mode to.
Definition: kncomposerview.cpp:192
boost::shared_ptr< KNNntpAccount > Ptr
Shared pointer to a KNNntpAccount.
Definition: knnntpaccount.h:62
File open helper (includes file open dialog and network download).
Definition: utilities.h:55
void setSpacing(int spacing)
bool isNull() const
void hideExternalNotification()
Definition: kncomposerview.cpp:494
void setCharset(const QString &charset)
Sets the character set to used to encode this message.
Definition: kncomposer.cpp:886
void addItem(const QString &text, const QVariant &userData)
void setBuddy(QWidget *buddy)
static void displayTempFileError(QWidget *w=0)
use this for error on temporary files
Definition: utilities.cpp:362
void setFrom(const QString &from)
Set the name and email address of the sender of the message.
Definition: kncomposerview.cpp:229
void slotMimeTypeTextChanged(const QString &text)
Definition: kncomposer.cpp:1644
void setEnabled(bool)
void addWidget(QWidget *widget, int stretch, QFlags< Qt::AlignmentFlag > alignment)
int count(const T &value) const
static MailList fromMimeData(const QMimeData *md)
void append(const T &value)
void ignore()
bool atEnd() const
KLineEdit * d_escription
Definition: kncomposer.h:258
KPIMIdentities::IdentityManager * identityManager()
Returns the identity manager.
Definition: knglobals.cpp:167
bool inherits(const char *className) const
const QStringList followupTo() const
Returns the followup-to list of groups (name are trimmed).
Definition: kncomposerview.cpp:284
bool isEmpty() const
bool isEmpty() const
QByteArray number(int n, int base)
virtual const KPIMIdentities::Identity & identity() const
Returns the global identity (or the default one when none is set yet).
Definition: settings.cpp:91
QFile * getFile(const QString &dialogTitle)
opens a file dialog and returns a file open for reading
Definition: utilities.cpp:113
QString to() const
QString subject() const
AttachmentPropertiesDlg(KNAttachment::Ptr a, QWidget *parent=0)
Create a dialog to edit attribute of a message attachment.
Definition: kncomposer.cpp:1534
typedef Iterator
Message is to be sent by e-mail and to a newsgroup.
Definition: kncomposer.h:53
void highLightWord(unsigned int length, unsigned int pos)
Definition: kncomposer.cpp:136
void showAttachmentView()
Definition: kncomposerview.cpp:396
KNode::Settings * settings()
Returns the KConfigXT generated settings object.
Definition: knglobals.cpp:182
virtual void writeConfig()
Reimplemented to hide writeConfig() from SettingsContainerInterface and delegate call to SettingsBase...
Definition: settings.h:102
Definition: kncomposer.h:47
void setMargin(int margin)
static bool canDecode(const QMimeData *md)
iterator end()
QString toLower() const
int key() const
void accept()
void setComposingFont(const QFont &font)
Changes the font used in edition widget within this ComposerView.
Definition: kncomposerview.cpp:182
bool contains(QChar ch, Qt::CaseSensitivity cs) const
void setFollowupTo(const QString &followupTo)
Sets the followup-to list as a string (must be a coma separated list of groups).
Definition: kncomposerview.cpp:290
static QString rewrapStringList(const QStringList &text, int wrapAt, QChar quoteChar, bool stopAtSig, bool alwaysSpace)
used for rewarping a text when replying to a message or inserting a file into a box ...
Definition: utilities.cpp:286
void showExternalNotification()
Definition: kncomposerview.cpp:488
const QStringList groups() const
Returns the followup-to list of groups (name are trimmed).
Definition: kncomposerview.cpp:235
virtual void dropEvent(QDropEvent *event)
Reimplemented to add the dropped files as attachments.
Definition: kncomposer.cpp:1510
const QList< KNAttachment::Ptr > attachments() const
Returns the list of attachments of this message.
Definition: kncomposerview.cpp:464
QString & replace(int position, int n, QChar after)
void slotAttachmentPopup(const QPoint &point)
Open a popup menu to do action on an attachment.
Definition: kncomposer.cpp:1494
QByteArray toLatin1() const
QList< KNAttachment::Ptr > mDeletedAttachments
Definition: kncomposer.h:130
void slotAutoSpellCheckingToggled()
Definition: kncomposer.cpp:1261
void addAttachment(KNAttachment::Ptr attachment)
Adds an attachment to the message.
Definition: kncomposerview.cpp:458
Definition: kncomposer.h:48
void setColumnStretch(int column, int stretch)
void hideAttachmentView()
Definition: kncomposerview.cpp:453
void slotAttachmentChanged()
Called by the View to notify that an attachment was modified.
Definition: kncomposer.cpp:1160
void addItem(QLayoutItem *item, int row, int column, int rowSpan, int columnSpan, QFlags< Qt::AlignmentFlag > alignment)
void composerDone(KNComposer *)
QTextCodec * codecForName(const QByteArray &name)
void spellCheckerMisspelling(const QString &text, const QStringList &, unsigned int pos)
Definition: kncomposer.cpp:147
bool applyChanges()
Applies changes from the editor into the article being edited.
Definition: kncomposer.cpp:722
Definition: kncomposer.h:47
void setCurrentIndex(int index)
void slotSubjectChanged(const QString &t)
Definition: kncomposer.cpp:1397
int length() const
char * data()
QString left(int n) const
static int selectDialog(QWidget *parent, const QString &caption, const QStringList &options, int initialValue)
list selection dialog, used instead of a popup menu when a select action is called via the keyboard...
Definition: utilities.cpp:163
QString fromLatin1(const char *str, int size)
QFile * setURL(const KUrl &url)
tries to access the file specified by the url and returns a file open for reading ...
Definition: utilities.cpp:129
virtual void dragEnterEvent(QDragEnterEvent *event)
Reimplemented to accept list of URI as drag content.
Definition: kncomposer.cpp:1502
void insertFile(QFile *file, bool clear=false, bool box=false, const QString &boxTitle=QString())
Inserts at cursor position if clear is false, replaces content otherwise puts the file content into a...
Definition: kncomposer.cpp:1011
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
iterator begin()
void completeSetup(bool firstEdit, KNComposer::MessageMode mode)
Completes the setup of this view.
Definition: kncomposerview.cpp:108
uint selectedIdentity() const
Return the UOID of the selected identity.
Definition: kncomposerview.cpp:201
void setEnabled(bool)
QString toUnicode(const QByteArray &a) const
QString selectedGroups() const
Definition: kngroupselectdialog.cpp:85
void setGroups(const QString &groups)
Sets the group list as a string (must be coma separated).
Definition: kncomposerview.cpp:241
Group selection dialog (used in the composer).
Definition: kngroupselectdialog.h:24
void slotUpdateCheckSpellChecking(bool _b)
Definition: kncomposer.cpp:407
void replace(int i, const T &value)
Definition: kncomposer.h:48
KNComposer(KNLocalArticle::Ptr a, const QString &text=QString(), const QString &unwraped=QString(), bool firstEdit=false, bool dislikesCopies=false, bool createCopy=false, bool allowMail=true)
Create a composer for a message (e-mail or newsgroup post).
Definition: kncomposer.cpp:163
void setPosition(int pos, MoveMode m)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:34:18 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:34:18 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.